diff --git a/config/apps/alacritty.nix b/config/apps/alacritty.nix new file mode 100644 index 0000000..5f664ac --- /dev/null +++ b/config/apps/alacritty.nix @@ -0,0 +1,35 @@ +{...}: +let + gruvbox-dark = import ../data/gruvbox-dark.nix {}; + +in { + programs.alacritty = { + enable = true; + settings = { + font.normal.family = "monospace"; + window = { + dynamic_title = true; + title = "Alacritty"; + }; + + # gruvbox dark theme + colors = { + primary = { + inherit (gruvbox-dark) background foreground; + }; + + inherit (gruvbox-dark) normal bright; + }; + + keyboard = { + bindings = [ + { + key = "Return"; + mods = "Shift|Control"; + action = "SpawnNewInstance"; + } + ]; + }; + }; + }; +} diff --git a/config/apps/default.nix b/config/apps/default.nix new file mode 100644 index 0000000..ca9030f --- /dev/null +++ b/config/apps/default.nix @@ -0,0 +1,7 @@ +{...}: { + imports = [ + ./firefox.nix + ./sway.nix + ./alacritty.nix + ]; +} diff --git a/config/apps/firefox.nix b/config/apps/firefox.nix new file mode 100644 index 0000000..f265027 --- /dev/null +++ b/config/apps/firefox.nix @@ -0,0 +1,32 @@ +{inputs, pkgs, ...}: let + user = import ../data/user.nix {}; +in{ + programs.firefox = { + enable = true; + profiles = { + default = { + isDefault = true; + + search = { + default = "ddg"; + force = true; + privateDefault = "ddg"; + }; + + settings = { + "browser.aboutConfig.showWarning" = false; + "browser.toolbars.bookmarks.visibility" = "never"; + "dom.webgpu.enabled" = true; + "gfx.webrender.all" = true; + "signon.rememberSignons" = false; + "identity.sync.tokenserver.uri" = "https://nirgendswo.com:8001/1.0/sync/1.5"; + "services.sync.username" = user.email; + }; + + extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [ + ublock-origin bitwarden rust-search-extension betterttv + ]; + }; + }; + }; +} diff --git a/config/apps/sway.nix b/config/apps/sway.nix new file mode 100644 index 0000000..949ce82 --- /dev/null +++ b/config/apps/sway.nix @@ -0,0 +1,140 @@ +{pkgs, lib, ...}: +let + base = import ./../options.nix; + + mod = "Mod4"; + left = "h"; + right = "l"; + up = "k"; + down = "j"; + +in { + wayland = { + windowManager = { + sway = { + enable = true; + systemd.enable = true; + + config = { + modifier = "${mod}"; + + gaps = { + inner = 8; + }; + + window = { + border = 3; + titlebar = false; + }; + + input = { + "type:pointer" = { + pointer_accel = "-1"; + }; + + "type:keyboard" = { + xkb_layout = "gb,dk"; + xkb_options = + "caps:escape,grp:menu_toggle,grp:rctrl_toggle"; + repeat_delay = "250"; + repeat_rate = "25"; + }; + + "type:touchpad" = { + natural_scroll = "enabled"; + tap = "enabled"; + tap_button_map = "lrm"; + pointer_accel = "0"; + }; + }; + + keybindings = with pkgs; { + "Print" = "exec screenshot"; + "${mod}+Print" = "exec screenshot --area"; + "${mod}+Shift+Print" = "exec screenshot --current-window"; + + "XF86AudioRaiseVolume" = "exec ${wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"; + "XF86AudioLowerVolume" = "exec ${wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"; + "XF86AudioMute" = "exec ${wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; + "XF86AudioMicMute" = "exec ${wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; + + "XF86AudioPlay" = "mpc toggle"; + "XF86AudioNext" = "mpc next"; + "XF86AudioPrev" = "mpc prev"; + + "XF86MonBrightnessUp" = "exec ${brightnessctl}/bin/brightnessctl set +10%"; + "XF86MonBrightnessDown" = "exec ${brightnessctl}/bin/brightnessctl set 10%-"; + + "${mod}+Shift+Return" = "exec ${alacritty}/bin/alacritty"; + "${mod}+q" = "kill"; + "${mod}+p" = "exec ${pkgs.rofi}/bin/rofi -combi-modes window,drun,run -modes combi,ssh -show combi -show-icons"; + "${mod}+Shift+e" = "exec ${pkgs.emacs}/bin/emacsclient -c -a ''"; + "${mod}+Shift+b" = "exec ${pkgs.firefox}/bin/firefox"; + "${mod}+Shift+c" = "reload"; + "${mod}+Shift+q" = "exec ${pkgs.sway}/bin/swaymsg exit"; + + "${mod}+${left}" = "focus left"; + "${mod}+${right}" = "focus right"; + "${mod}+${up}" = "focus up"; + "${mod}+${down}" = "focus down"; + + "${mod}+Shift+${left}" = "move left"; + "${mod}+Shift+${right}" = "move right"; + "${mod}+Shift+${up}" = "move up"; + "${mod}+Shift+${down}" = "move down"; + + "${mod}+Ctrl+${left}" = "move workspace to output left"; + "${mod}+Ctrl+${right}" = "move workspace to output right"; + + "${mod}+b" = "splith"; + "${mod}+v" = "splitv"; + + "${mod}+s" = "layout stacking"; + "${mod}+w" = "layout tabbed"; + "${mod}+e" = "layout toggle split"; + + "${mod}+Shift+space" = "layout toggle floating"; + "${mod}+space" = "focus mode_toggle"; + "${mod}+Shift+f" = "fullscreen"; + + } // lib.attrsets.mergeAttrsList (map + (n: let workspace = toString n; in { + "${mod}+${workspace}" = "workspace ${workspace}"; + "${mod}+Shift+${workspace}" = "move container to workspace ${workspace}"; + }) + [1 2 3 4 5 6 7 8 9 0] + ); + + colors = { + focused = { + background = "#A7C080"; + text = "#272E33"; + indicator = "#A7C080"; + border = "#A7C080"; + childBorder = "#A7C080"; + }; + unfocused = { + background = "#9DA9A0"; + text = "#272E33"; + indicator = "#9DA9A0"; + border = "#9DA9A0"; + childBorder = "#9DA9A0"; + }; + urgent = { + background = "#E67E80"; + text = "#272E33"; + indicator = "#E67E80"; + border = "#E67E80"; + childBorder = "#E67E80"; + }; + }; + }; + }; + }; + }; + + programs.waybar = { + enable = true; + systemd.enable = true; + }; +} diff --git a/config/data/gruvbox-dark.nix b/config/data/gruvbox-dark.nix new file mode 100644 index 0000000..a5bd438 --- /dev/null +++ b/config/data/gruvbox-dark.nix @@ -0,0 +1,26 @@ +{...}: { + background = "#282828"; + foreground = "#ebdbb2"; + + normal = { + black = "#282828"; + red = "#cc241d"; + green = "#98971a"; + yellow = "#d79921"; + blue = "#458588"; + magenta = "#b16286"; + cyan = "#689d6a"; + white = "#a89984"; + }; + + bright = { + black = "#928374"; + red = "#fb4934"; + green = "#b8bb26"; + yellow = "#fabd2f"; + blue = "#83a598"; + magenta = "#d3869b"; + cyan = "#8ec07c"; + white = "#ebdbb2"; + }; +} diff --git a/config/data/gruvbox-light.nix b/config/data/gruvbox-light.nix new file mode 100644 index 0000000..9058095 --- /dev/null +++ b/config/data/gruvbox-light.nix @@ -0,0 +1,26 @@ +{...}: { + background = "#fbf1c7"; + foreground = "#3c3836"; + + normal = { + black = "#fbf1c7"; + red = "#cc241d"; + green = "#98971a"; + yellow = "#d79921"; + blue = "#458588"; + magenta = "#b16286"; + cyan = "#689d6a"; + white = "#7c6f64"; + }; + + bright = { + black = "#928374"; + red = "#9d0006"; + green = "#79740e"; + yellow = "#b57614"; + blue = "#076678"; + magenta = "#8f3f71"; + cyan = "#427b58"; + white = "#3c3836"; + }; +} diff --git a/config/data/user.nix b/config/data/user.nix new file mode 100644 index 0000000..3b1c1f6 --- /dev/null +++ b/config/data/user.nix @@ -0,0 +1,3 @@ +{...}: { + email = "janis@nirgendwo.xyz"; +} diff --git a/config/flake.nix b/config/flake.nix index a7e7b42..51d663d 100644 --- a/config/flake.nix +++ b/config/flake.nix @@ -5,18 +5,30 @@ # i.e. nixos-24.11 # Use `nix flake update` to update the flake to the latest revision of the chosen release channel. nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + # nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; # Use the same nixpkgs as the system }; + disko = { + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nur.url = "github:nix-community/nur"; + # firefox-addons = { + # url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; + # inputs.nixpkgs.follows = "nixpkgs"; # Use the same nixpkgs as the system + # }; }; outputs = inputs @ { self, nixpkgs, home-manager, ... }: - { + let + system = "x86_64-linux"; # Default system architecture + in { # NOTE: 'nixos' is the default hostname nixosConfigurations = { nixos = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; # Change this to your system architecture if needed + inherit system; modules = [ ./configuration.nix @@ -24,11 +36,23 @@ { home-manager.useGlobalPkgs = true; # Use global packages in home-manager home-manager.useUserPackages = true; # Use user packages in home-manager + + home-manager.extraSpecialArgs = { + inherit inputs; + }; } ]; specialArgs = { - inherit home-manager; + inherit inputs home-manager; + }; + + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; # Allow unfree packages globally + overlays = [ + inputs.nur.overlays.default + ]; }; }; }; diff --git a/config/nixos/default.nix b/config/nixos/default.nix index f932181..03c5cfb 100644 --- a/config/nixos/default.nix +++ b/config/nixos/default.nix @@ -2,5 +2,8 @@ imports = [ ./hardware.nix ./system.nix + ./plymouth.nix + ./fonts.nix + ./login.nix ]; } diff --git a/config/nixos/fonts.nix b/config/nixos/fonts.nix new file mode 100644 index 0000000..ace0f4b --- /dev/null +++ b/config/nixos/fonts.nix @@ -0,0 +1,33 @@ +{pkgs, ...}: { + fonts = { + enableDefaultPackages = true; + packages = with pkgs; [ + noto-fonts + noto-fonts-cjk-sans + noto-fonts-emoji + liberation_ttf + roboto + roboto-mono + twitter-color-emoji + nerd-fonts.fira-code + nerd-fonts.fira-mono + unicode-emoji + fira-sans + font-awesome + fira-mono + fira-code + material-icons + source-sans + source-code-pro + pkgs.nur.repos.redpz.sf-mono + ]; + fontconfig = { + defaultFonts = { + monospace = ["SF Mono" "Fira Mono" "Noto Mono"]; + serif = ["Liberation Serif" "Noto Serif"]; + sansSerif = ["Liberation Sans" "Noto Sans" "Roboto"]; + emoji = ["Twitter Color Emoji" "Noto Emoji"]; + }; + }; + }; +} diff --git a/config/nixos/login.nix b/config/nixos/login.nix new file mode 100644 index 0000000..329ea59 --- /dev/null +++ b/config/nixos/login.nix @@ -0,0 +1,16 @@ +# This file is part of the NixOS configuration for the login service. +{pkgs, ...}: { + environment.systemPackages = [ pkgs.sddm-chili-theme ]; + services = { + displayManager = { + enable = true; + sddm = { + enableHidpi = true; + enable = true; + theme = "chili"; + wayland.enable = true; + }; + sessionPackages = with pkgs; [sway]; + }; + }; +} diff --git a/config/nixos/plymouth.nix b/config/nixos/plymouth.nix new file mode 100644 index 0000000..54e9f13 --- /dev/null +++ b/config/nixos/plymouth.nix @@ -0,0 +1,25 @@ +{pkgs, ...}: { + boot = { + plymouth = { + enable = true; + theme = "rings"; + themePackages = with pkgs; [ + (adi1090x-plymouth-themes.override { + selected_themes = [ "rings" ]; + }) + ]; + }; + + consoleLogLevel = 3; + initrd.verbose = false; + kernelParams = [ + "quiet" + "splash" + "boot.shell_on_fail" + "udev.log_priority=3" + "rd.systemd.show_status=auto" + ]; + + loader.timeout = 0; + }; +} diff --git a/config/nixos/system.nix b/config/nixos/system.nix index 26a1776..fc583e5 100644 --- a/config/nixos/system.nix +++ b/config/nixos/system.nix @@ -4,8 +4,6 @@ let in { system.stateVersion = "${base.stateVersion}"; - nixpkgs.config.allowUnfree = true; # Allow unfree packages, if necessary. - nix.settings.experimental-features = [ "nix-command" "flakes" diff --git a/config/users/alice.nix b/config/users/alice.nix index cf5cd7e..5093740 100644 --- a/config/users/alice.nix +++ b/config/users/alice.nix @@ -2,6 +2,10 @@ inputs @ { pkgs, lib, ...}: let # NixOS version # Function to create the home-manager configuration for the account aliceUserFn = {pkgs, ...}: { + imports = [ + ../apps + ]; + home = { packages = with pkgs; [ htop @@ -16,6 +20,10 @@ inputs @ { pkgs, lib, ...}: let ll = "ls -l"; la = "ls -la"; git-tree = "git log --graph --oneline --all"; + c = "clear"; + q = "exit"; + ssh = "TERM=xterm-256color ssh"; + emacs = "emacs -nw"; # Use emacs in terminal mode. }; }; }; diff --git a/config/users/user.nix b/config/users/user.nix index c4a9877..614ab3d 100644 --- a/config/users/user.nix +++ b/config/users/user.nix @@ -26,7 +26,7 @@ in { initialPassword = user.defaultPassword; }; - home-manager.users.${username} = { + home-manager.users.${username} = {...}: { imports = [ user.userModule ]; # programs.home-manager.enable = true;