From c343c52ab73f5cddf9bfd401fb8427df2049e675 Mon Sep 17 00:00:00 2001 From: alisceon Date: Tue, 10 Mar 2026 21:50:51 +0100 Subject: [PATCH] entirely vibed refactor --- flake.nix | 199 +++++++++--------- home/alisceon/base.nix | 6 - home/alisceon/default.nix | 21 -- home/alisceon/modules/programs/chromium.nix | 17 -- home/alisceon/modules/programs/direnv.nix | 8 - home/alisceon/modules/programs/discord.nix | 6 - home/alisceon/modules/programs/foot.nix | 21 -- home/alisceon/modules/programs/nushell.nix | 7 - home/alisceon/modules/programs/rofi.nix | 12 -- home/alisceon/modules/programs/vscode.nix | 48 ----- home/alisceon/modules/programs/waybar.nix | 112 ---------- home/alisceon/modules/services/espanso.nix | 66 ------ home/alisceon/modules/services/syncthing.nix | 6 - home/alisceon/modules/wm/gnome/default.nix | 5 - home/alisceon/server.nix | 3 - .../hosts => hosts/alisceon}/electra.nix | 10 +- .../hosts => hosts/alisceon}/tower.nix | 4 +- home/modules/programs/chromium.nix | 18 ++ home/modules/programs/direnv.nix | 8 + home/modules/programs/discord.nix | 4 + home/{alisceon => }/modules/programs/fish.nix | 7 +- home/modules/programs/foot.nix | 15 ++ home/{alisceon => }/modules/programs/git.nix | 8 +- .../{alisceon => }/modules/programs/kitty.nix | 6 +- home/modules/programs/nushell.nix | 7 + home/modules/programs/rofi.nix | 12 ++ home/{alisceon => }/modules/programs/ssh.nix | 16 +- .../modules/programs/swaylock.nix | 8 +- home/modules/programs/vscode.nix | 44 ++++ home/modules/programs/waybar.nix | 104 +++++++++ home/modules/services/espanso.nix | 54 +++++ .../modules/services/gnome-keyring.nix | 4 +- home/{alisceon => }/modules/services/mako.nix | 8 +- .../modules/services/swayidle.nix | 12 +- home/modules/services/syncthing.nix | 4 + .../{alisceon => }/modules/wm/gnome/dconf.nix | 14 +- home/modules/wm/gnome/default.nix | 6 + .../modules/wm/sway/default.nix | 118 +++++------ home/{alisceon => }/modules/wm/sway/gtk.nix | 4 +- home/{alisceon => }/modules/wm/sway/xdg.nix | 8 +- home/profiles/base.nix | 6 + home/profiles/server.nix | 3 + home/{alisceon => profiles}/workstation.nix | 23 +- home/root/base.nix | 6 - home/root/default.nix | 12 -- home/users/alisceon/default.nix | 20 ++ home/users/root/default.nix | 11 + home/wm/sway.nix | 18 -- hosts/base.nix | 6 - hosts/common/server.nix | 20 -- hosts/common/wm/sway.nix | 108 ---------- hosts/default.nix | 6 - hosts/electra/configuration.nix | 43 ---- hosts/hosts/electra.nix | 6 - hosts/hosts/nuc.nix | 6 - hosts/hosts/tesla-nixos.nix | 6 - hosts/hosts/tower.nix | 6 - hosts/modules/stylix.nix | 6 - hosts/modules/wm/gnome/default.nix | 6 - hosts/modules/wm/sway/default.nix | 6 - hosts/nuc/configuration.nix | 65 ------ hosts/server.nix | 6 - hosts/workstation.nix | 6 - {home/alisceon/lib => lib}/commands.nix | 0 nixos/hosts/electra/configuration.nix | 40 ++++ .../hosts}/electra/hardware-configuration.nix | 0 nixos/hosts/nuc/configuration.nix | 48 +++++ .../hosts}/nuc/hardware-configuration.nix | 0 .../hosts}/tesla-nixos/configuration.nix | 88 ++++---- .../tesla-nixos/hardware-configuration.nix | 0 .../hosts}/tower/configuration.nix | 53 +++-- .../hosts}/tower/hardware-configuration.nix | 0 .../default.nix => nixos/modules/base.nix | 143 ++++++------- nixos/modules/profiles/server.nix | 14 ++ .../modules/profiles}/workstation.nix | 30 +-- .../common => nixos/modules/theme}/stylix.nix | 12 +- {hosts/common => nixos/modules}/wm/gnome.nix | 15 +- nixos/modules/wm/sway.nix | 99 +++++++++ 78 files changed, 884 insertions(+), 1099 deletions(-) delete mode 100644 home/alisceon/base.nix delete mode 100644 home/alisceon/default.nix delete mode 100644 home/alisceon/modules/programs/chromium.nix delete mode 100644 home/alisceon/modules/programs/direnv.nix delete mode 100644 home/alisceon/modules/programs/discord.nix delete mode 100644 home/alisceon/modules/programs/foot.nix delete mode 100644 home/alisceon/modules/programs/nushell.nix delete mode 100644 home/alisceon/modules/programs/rofi.nix delete mode 100644 home/alisceon/modules/programs/vscode.nix delete mode 100644 home/alisceon/modules/programs/waybar.nix delete mode 100644 home/alisceon/modules/services/espanso.nix delete mode 100644 home/alisceon/modules/services/syncthing.nix delete mode 100644 home/alisceon/modules/wm/gnome/default.nix delete mode 100644 home/alisceon/server.nix rename home/{alisceon/hosts => hosts/alisceon}/electra.nix (74%) rename home/{alisceon/hosts => hosts/alisceon}/tower.nix (94%) create mode 100644 home/modules/programs/chromium.nix create mode 100644 home/modules/programs/direnv.nix create mode 100644 home/modules/programs/discord.nix rename home/{alisceon => }/modules/programs/fish.nix (56%) create mode 100644 home/modules/programs/foot.nix rename home/{alisceon => }/modules/programs/git.nix (62%) rename home/{alisceon => }/modules/programs/kitty.nix (68%) create mode 100644 home/modules/programs/nushell.nix create mode 100644 home/modules/programs/rofi.nix rename home/{alisceon => }/modules/programs/ssh.nix (86%) rename home/{alisceon => }/modules/programs/swaylock.nix (56%) create mode 100644 home/modules/programs/vscode.nix create mode 100644 home/modules/programs/waybar.nix create mode 100644 home/modules/services/espanso.nix rename home/{alisceon => }/modules/services/gnome-keyring.nix (70%) rename home/{alisceon => }/modules/services/mako.nix (76%) rename home/{alisceon => }/modules/services/swayidle.nix (83%) create mode 100644 home/modules/services/syncthing.nix rename home/{alisceon => }/modules/wm/gnome/dconf.nix (94%) create mode 100644 home/modules/wm/gnome/default.nix rename home/{alisceon => }/modules/wm/sway/default.nix (67%) rename home/{alisceon => }/modules/wm/sway/gtk.nix (67%) rename home/{alisceon => }/modules/wm/sway/xdg.nix (93%) create mode 100644 home/profiles/base.nix create mode 100644 home/profiles/server.nix rename home/{alisceon => profiles}/workstation.nix (64%) delete mode 100644 home/root/base.nix delete mode 100644 home/root/default.nix create mode 100644 home/users/alisceon/default.nix create mode 100644 home/users/root/default.nix delete mode 100644 home/wm/sway.nix delete mode 100644 hosts/base.nix delete mode 100644 hosts/common/server.nix delete mode 100644 hosts/common/wm/sway.nix delete mode 100644 hosts/default.nix delete mode 100644 hosts/electra/configuration.nix delete mode 100644 hosts/hosts/electra.nix delete mode 100644 hosts/hosts/nuc.nix delete mode 100644 hosts/hosts/tesla-nixos.nix delete mode 100644 hosts/hosts/tower.nix delete mode 100644 hosts/modules/stylix.nix delete mode 100644 hosts/modules/wm/gnome/default.nix delete mode 100644 hosts/modules/wm/sway/default.nix delete mode 100644 hosts/nuc/configuration.nix delete mode 100644 hosts/server.nix delete mode 100644 hosts/workstation.nix rename {home/alisceon/lib => lib}/commands.nix (100%) create mode 100644 nixos/hosts/electra/configuration.nix rename {hosts => nixos/hosts}/electra/hardware-configuration.nix (100%) create mode 100644 nixos/hosts/nuc/configuration.nix rename {hosts => nixos/hosts}/nuc/hardware-configuration.nix (100%) rename {hosts => nixos/hosts}/tesla-nixos/configuration.nix (51%) rename {hosts => nixos/hosts}/tesla-nixos/hardware-configuration.nix (100%) rename {hosts => nixos/hosts}/tower/configuration.nix (69%) rename {hosts => nixos/hosts}/tower/hardware-configuration.nix (100%) rename hosts/common/default.nix => nixos/modules/base.nix (67%) create mode 100644 nixos/modules/profiles/server.nix rename {hosts/common => nixos/modules/profiles}/workstation.nix (76%) rename {hosts/common => nixos/modules/theme}/stylix.nix (88%) rename {hosts/common => nixos/modules}/wm/gnome.nix (75%) create mode 100644 nixos/modules/wm/sway.nix diff --git a/flake.nix b/flake.nix index 8ca6bf9..dadc18d 100644 --- a/flake.nix +++ b/flake.nix @@ -23,128 +23,133 @@ nix-minecraft.url = "github:Infinidoge/nix-minecraft"; }; - outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, nur, nur-unstable, home-manager, stylix, nix-minecraft, ... }: + outputs = inputs @ { + self, + nixpkgs, + nixpkgs-unstable, + nur, + nur-unstable, + home-manager, + stylix, + nix-minecraft, + ... + }: let system = "x86_64-linux"; + repoLocalPath = "/home/alisceon/.nixos_config"; + pkgs = import nixpkgs { inherit system; config.allowUnfree = true; flake.setFlakeRegistry = true; overlays = [ nur.overlays.default ]; }; + pkgs-unstable = import nixpkgs-unstable { inherit system; config.allowUnfree = true; flake.setFlakeRegistry = true; overlays = [ nur-unstable.overlays.default ]; }; + sharedSpecialArgs = { - inherit pkgs-unstable; - inherit inputs; + inherit inputs pkgs-unstable repoLocalPath; + repoRoot = self; }; + sharedModules = [ - ./hosts/base.nix + ./nixos/modules/base.nix stylix.nixosModules.stylix home-manager.nixosModules.home-manager - ({ config, ...}: { + ({ ... }: { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { - inherit (config.networking) hostName; - inherit pkgs pkgs-unstable; - }; # end extraSpecialArgs + inherit pkgs pkgs-unstable repoLocalPath; + repoRoot = self; + }; home-manager.backupFileExtension = "backup"; - }) # end home manager - ]; # end sharedModules + }) + ]; + + mkHost = { + hostName, + nixosModules ? [ ], + hmModules ? [ ], + extraModules ? [ ], + }: + nixpkgs.lib.nixosSystem { + inherit system pkgs; + specialArgs = sharedSpecialArgs; + modules = + sharedModules + ++ [ (./nixos/hosts + "/${hostName}/configuration.nix") ] + ++ nixosModules + ++ extraModules + ++ [ + { + home-manager.users.alisceon.imports = + [ ./home/profiles/base.nix ] + ++ hmModules; + home-manager.users.root.imports = [ + ./home/users/root/default.nix + ]; + } + ]; + }; + + workstationModules = [ + ./nixos/modules/profiles/workstation.nix + ./nixos/modules/wm/sway.nix + ./nixos/modules/theme/stylix.nix + ]; + + workstationHomeModules = [ + ./home/profiles/workstation.nix + ./home/modules/wm/sway/default.nix + ]; + + serverModules = [ + ./nixos/modules/profiles/server.nix + ]; + + serverHomeModules = [ + ./home/profiles/server.nix + ]; in { nixosConfigurations = { - electra = nixpkgs.lib.nixosSystem { - inherit system; - inherit pkgs; - specialArgs = sharedSpecialArgs // {}; - modules = sharedModules ++ [ - ./hosts/hosts/electra.nix - ./hosts/workstation.nix - ./hosts/modules/wm/sway/default.nix - ./hosts/modules/stylix.nix - home-manager.nixosModules.home-manager - ({ config, ...}: { - home-manager.users.alisceon.imports = [ - ./home/alisceon/base.nix - ./home/alisceon/workstation.nix - ./home/wm/sway.nix - ./home/alisceon/hosts/electra.nix - ]; - home-manager.users.root.imports = [ - ./home/root/base.nix - ]; - }) # end home-manager - ]; # end modules - }; # end electra - tower = nixpkgs.lib.nixosSystem { - inherit system; - inherit pkgs; - specialArgs = sharedSpecialArgs // {}; - modules = sharedModules ++ [ - ./hosts/hosts/tower.nix - ./hosts/workstation.nix - ./hosts/modules/wm/sway/default.nix - ./hosts/modules/stylix.nix - home-manager.nixosModules.home-manager - ({ config, ...}: { - home-manager.users.alisceon.imports = [ - ./home/alisceon/base.nix - ./home/alisceon/workstation.nix - ./home/wm/sway.nix - ./home/alisceon/hosts/tower.nix - ]; - home-manager.users.root.imports = [ - ./home/root/base.nix - ]; - }) # end home-manager - ]; # end modules - }; # end tower - tesla-nixos = nixpkgs.lib.nixosSystem { - inherit system; - inherit pkgs; - specialArgs = sharedSpecialArgs // {}; - modules = sharedModules ++ [ - ./hosts/server.nix - ./hosts/hosts/tesla-nixos.nix + electra = mkHost { + hostName = "electra"; + nixosModules = workstationModules; + hmModules = workstationHomeModules ++ [ + ./home/hosts/alisceon/electra.nix + ]; + }; + + tower = mkHost { + hostName = "tower"; + nixosModules = workstationModules; + hmModules = workstationHomeModules ++ [ + ./home/hosts/alisceon/tower.nix + ]; + }; + + tesla-nixos = mkHost { + hostName = "tesla-nixos"; + nixosModules = serverModules; + hmModules = serverHomeModules; + extraModules = [ nix-minecraft.nixosModules.minecraft-servers { nixpkgs.overlays = [ inputs.nix-minecraft.overlay ]; } - home-manager.nixosModules.home-manager - ({ config, ...}: { - home-manager.users.alisceon.imports = [ - ./home/alisceon/base.nix - ./home/alisceon/server.nix - ]; - home-manager.users.root.imports = [ - ./home/root/base.nix - ]; - }) # end home-manager - ]; # end modules - }; # end tesla-nixos - nuc = nixpkgs.lib.nixosSystem { - inherit system; - inherit pkgs; - specialArgs = sharedSpecialArgs // {}; - modules = sharedModules ++ [ - ./hosts/server.nix - ./hosts/hosts/nuc.nix - home-manager.nixosModules.home-manager - ({ config, ...}: { - home-manager.users.alisceon.imports = [ - ./home/alisceon/base.nix - ./home/alisceon/server.nix - ]; - home-manager.users.root.imports = [ - ./home/root/base.nix - ]; - }) # end home-manager - ]; # end modules - }; # end tesla-nixos - }; # end nixos conf - }; # end "in" -} # end file + ]; + }; + + nuc = mkHost { + hostName = "nuc"; + nixosModules = serverModules; + hmModules = serverHomeModules; + }; + }; + }; +} diff --git a/home/alisceon/base.nix b/home/alisceon/base.nix deleted file mode 100644 index 60e690e..0000000 --- a/home/alisceon/base.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - imports = [ - ./default.nix - ]; -} # end file diff --git a/home/alisceon/default.nix b/home/alisceon/default.nix deleted file mode 100644 index fe6c1b0..0000000 --- a/home/alisceon/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ pkgs, config, hostName, lib, ... }: -{ - imports = [ - ./modules/programs/direnv.nix - ./modules/programs/git.nix - ./modules/programs/ssh.nix - ]; - - home.username = "alisceon"; - home.homeDirectory = "/home/alisceon"; - home.stateVersion = "24.05"; - manual.manpages.enable = true; - # nixpkgs config - xdg.configFile."nixpkgs/config.nix".source = ../conf/config.nix; - - # xonsh extras - xdg.configFile."xonsh/theo.py".source = ../conf/xonsh/theo.py; - xdg.configFile."xonsh/kittycatsay.py".source = ../conf/xonsh/kittycatsay.py; - # Ensure fish exists for the completer backend - home.packages = [ pkgs.fish ]; -} # end file diff --git a/home/alisceon/modules/programs/chromium.nix b/home/alisceon/modules/programs/chromium.nix deleted file mode 100644 index b2f0cbd..0000000 --- a/home/alisceon/modules/programs/chromium.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ pkgs, config, hostName, lib, ... }: { - programs.chromium = { - enable = true; - commandLineArgs = [ - "--enable-features=TouchpadOverscrollHistoryNavigation,VaapiVideoDecoder" - ]; - extensions = [ - { id = "ddkjiahejlhfcafbddmgiahcphecmpfh"; } # ublock origin lite - { id = "nngceckbapebfimnlniiiahkandclblb"; } # bitwarden - { id = "mdjildafknihdffpkfmmpnpoiajfjnjd"; } # consent-o-matic - { id = "mnjggcdmjocbbbhaepdhchncahnbgone"; } # sponsorblock - { id = "ijcpiojgefnkmcadacmacogglhjdjphj"; } # shinigami eyes - { id = "kbmfpngjjgdllneeigpgjifpgocmfgmb"; } # reddit enhancement suite - { id = "einpaelgookohagofgnnkcfjbkkgepnp"; } # Random User-Agent - ]; - }; # end programs.chromium -} # end file diff --git a/home/alisceon/modules/programs/direnv.nix b/home/alisceon/modules/programs/direnv.nix deleted file mode 100644 index f2616a4..0000000 --- a/home/alisceon/modules/programs/direnv.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, config, hostName, lib, ... }: -{ - programs.direnv = { - enable = true; - silent = true; - nix-direnv.enable = true; - }; # end programs.direnv -} # end file diff --git a/home/alisceon/modules/programs/discord.nix b/home/alisceon/modules/programs/discord.nix deleted file mode 100644 index e5c4d59..0000000 --- a/home/alisceon/modules/programs/discord.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs, config, hostName, lib, ... }: -{ - programs.discord = { - enable = true; - }; # end programs.discord -} # end file diff --git a/home/alisceon/modules/programs/foot.nix b/home/alisceon/modules/programs/foot.nix deleted file mode 100644 index ca3bbce..0000000 --- a/home/alisceon/modules/programs/foot.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ pkgs, config, hostName, lib, ... }: -{ - programs = { - foot = { - enable = true; - server.enable = true; - settings = { - main = { - app-id = "footclient"; - workers = 32; - }; - bell = { - system = "no"; - }; - scrollback = { - lines = 100000; - }; - }; - }; # end foot - }; # end programs -} # end file diff --git a/home/alisceon/modules/programs/nushell.nix b/home/alisceon/modules/programs/nushell.nix deleted file mode 100644 index 5912a70..0000000 --- a/home/alisceon/modules/programs/nushell.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs, config, hostName, lib, ... }: -{ - programs.nushell = { - enable = false; - configFile.source = ../conf/config.nu; - }; # end programs.nushell -} # end file diff --git a/home/alisceon/modules/programs/rofi.nix b/home/alisceon/modules/programs/rofi.nix deleted file mode 100644 index 5b330c3..0000000 --- a/home/alisceon/modules/programs/rofi.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, config, hostName, lib, ... }: -let - commands = import ../../lib/commands.nix { inherit pkgs; }; - inherit (commands) term; -in -{ - programs.rofi = { - enable = true; - package = pkgs.rofi-unwrapped; - terminal = term; - }; # end programs.rofi -} # end file diff --git a/home/alisceon/modules/programs/vscode.nix b/home/alisceon/modules/programs/vscode.nix deleted file mode 100644 index 362ee32..0000000 --- a/home/alisceon/modules/programs/vscode.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ pkgs, config, hostName, lib, ... }: -{ - programs.vscode = { - enable = true; - package = pkgs.vscodium.fhsWithPackages ( - ps: with ps; [ - git - ] - ); - profiles = { - "default" = { - userSettings = { - "python.languageServer" = "None"; - "python.pyrefly.displayTypeErrors" = "force-on"; - "explorer.confirmDelete" = false; - "explorer.confirmDragAndDrop" = false; - "explorer.confirmPasteNative" = false; - "git.confirmSync" = false; - }; - extensions = [ - pkgs.vscode-extensions.ms-python.python - pkgs.vscode-extensions.ms-python.debugpy - pkgs.vscode-extensions.ms-vscode.cpptools - pkgs.vscode-extensions.jnoortheen.nix-ide - ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ - { - name = "xonsh"; - publisher = "jnoortheen"; - version = "0.3.3"; - hash = "sha256-EdAjVzqvbiSm/hL/SeJIlfY1QocpQPyzv4RV84t4bbg="; - } - { - name = "pyrefly"; - publisher = "meta"; - version = "0.52.0"; - hash = "sha256-vheW8D2jy3aTpAR/jsgw8Khj1z08GGmRaeYvL+UOXSI="; - } - { - name = "chatgpt"; - publisher = "openai"; - version = "0.5.74"; - hash = "sha256-yR9oR3w4AkoWaQDPwSaQtrKL6IcXANaMfFiw6K/b5o0="; - } - ]; # end extensions - }; # end default - }; # end profiles - }; # end programs.vscode -} # end file diff --git a/home/alisceon/modules/programs/waybar.nix b/home/alisceon/modules/programs/waybar.nix deleted file mode 100644 index 224e8b1..0000000 --- a/home/alisceon/modules/programs/waybar.nix +++ /dev/null @@ -1,112 +0,0 @@ -{ pkgs, config, hostName, lib, ... }: -let - commands = import ../../lib/commands.nix { inherit pkgs; }; - inherit (commands) uwsm term; -in -{ - programs.waybar = { - enable = true; - systemd = { - enable = true; - target = "graphical-session.target"; - }; - settings = { - mainBar = { - layer = "bottom"; - position = "top"; - height = 28; - spacing = 0; - modules-left = [ - "sway/workspaces" - ]; - modules-center = [ - "sway/window" - ]; - modules-right = [ - "tray" - "idle_inhibitor" - "network" - "bluetooth" - "pulseaudio" - "battery" - "sway/language" - "clock" - ]; - "sway/workspaces" = { - on-click = "activate"; - sort-by-number = true; - format = "{value}"; - }; - "sway/window" = { - max-length = 64; - }; - "tray" = { - icon-size = 24; - spacing = 8; - }; - "idle_inhibitor" = { - format = "| {icon}"; - start-activated = true; - format-icons = { - activated = "đŸĢ¨"; - deactivated = "😴"; - }; - }; - "sway/language" = { - format = "| {flag}"; - tooltip-format = "{long}"; - }; - "clock" = { - interval = 60; - tooltip = true; - format = "| {:%H:%M} "; - tooltip-format = "{:%Y-%m-%d}"; - }; - "battery" = { - interval = 60; - format = "| {icon}{capacity}%"; - format-charging = "| {icon}⚡{capacity}%"; - format-plugged = "| {icon}🔌{capacity}%"; - states = { - critical = 10; - warning = 20; - good = 100; - full = 100; - over = 101; - }; - format-icons = [ "đŸĒĢ" "đŸĒĢ" "🔋" "🔋" "🔋"]; - }; - "network" = { - tooltip-format = "{ifname} = {ipaddr}/{cidr}"; - format-wifi = "| ᯤ"; - format-ethernet = "| ⇄"; - format-linked = "| 🔗"; - format-disconnected = "| â›“ī¸â€đŸ’Ĩ"; - interval = 15; - on-click = "${uwsm} ${term} -e nmtui"; - }; - "bluetooth" = { - format-connected = "| ᛒ"; - format-on = "| ᚧ"; - format-disabled = ""; - format-no-controller = ""; - interval = 15; - on-click = "${uwsm} ${term} -e bluetui"; - }; - "pulseaudio" = { - format = "| 🔊{volume}%"; - format-muted = "| 🔈0%"; - format-bluetooth = "| 🎧{volume}%"; - on-click = "${uwsm} pavucontrol"; - }; - }; # end mainbar - }; # end settings - style = '' - button { - box-shadow: inset 0 -8px transparent; - border: none; - border-radius: 0; - } - ''; # end style - }; # end programs.waybar -} # end file diff --git a/home/alisceon/modules/services/espanso.nix b/home/alisceon/modules/services/espanso.nix deleted file mode 100644 index 835b2ae..0000000 --- a/home/alisceon/modules/services/espanso.nix +++ /dev/null @@ -1,66 +0,0 @@ -{ pkgs, config, hostName, lib, ... }: -{ - services.espanso = { - enable = true; - waylandSupport = true; - configs = { - default = { - toggle_key = "OFF"; - preserve_clipboard = true; - show_notifications = true; - keyboard_layout = { layout = "se"; }; - }; - }; - matches = { - base = { - matches = [ - { - trigger = ":ip "; - replace = "{{pubip}} "; - } - { - trigger = ":gw2hs "; - replace = "Full Homestead ^w^ "; - } - { - regex = ":format (?P\\S+) (?P\\S+) "; - replace = "{{format_text}} "; - vars = [ - { - name = "format_text"; - type = "shell"; - params = { - cmd = "${pkgs.python3}/bin/python3 /home/alisceon/.nixos_config/util/format_text.py $ESPANSO_ALPHABET $ESPANSO_TEXT"; - }; - } - ]; - } - { - regex = ";;(?P\\S+) "; - replace = "{{emoji}} "; - vars = [ - { - name = "emoji"; - type = "shell"; - params = { - cmd = "${pkgs.python3}/bin/python3 /home/alisceon/.nixos_config/util/get_emoji.py $ESPANSO_EMNAME"; - }; - } - ]; - } - ]; - }; - global_vars = { - global_vars = [ - { - name = "pubip"; - type = "shell"; - params = { - cmd = "curl -s https://ifconfig.me"; - }; - } - ]; - }; - }; # end matches - }; # end services.espanso -} # end file diff --git a/home/alisceon/modules/services/syncthing.nix b/home/alisceon/modules/services/syncthing.nix deleted file mode 100644 index 8ea38e2..0000000 --- a/home/alisceon/modules/services/syncthing.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs, config, hostName, lib, ... }: -{ - services.syncthing = { - enable = true; - }; -} # end file diff --git a/home/alisceon/modules/wm/gnome/default.nix b/home/alisceon/modules/wm/gnome/default.nix deleted file mode 100644 index a4d0a4c..0000000 --- a/home/alisceon/modules/wm/gnome/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ pkgs, config, hostName, lib, ... }: { - imports = [ - "./dconf.nix" - ] -} # end file diff --git a/home/alisceon/server.nix b/home/alisceon/server.nix deleted file mode 100644 index d4cc402..0000000 --- a/home/alisceon/server.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ ... }: -{ -} # end file diff --git a/home/alisceon/hosts/electra.nix b/home/hosts/alisceon/electra.nix similarity index 74% rename from home/alisceon/hosts/electra.nix rename to home/hosts/alisceon/electra.nix index fb672ea..2d31169 100644 --- a/home/alisceon/hosts/electra.nix +++ b/home/hosts/alisceon/electra.nix @@ -1,9 +1,5 @@ -{ pkgs, config, hostName, lib, ... }: +{ ... }: { - imports = [ - ../modules/services/swayidle.nix - ]; - wayland.windowManager.sway.config = { output = { eDP-1 = { @@ -16,7 +12,7 @@ }; }; - workspaceOutputAssign = []; + workspaceOutputAssign = [ ]; input."*" = { xkb_layout = "se,us"; @@ -25,4 +21,4 @@ }; services.espanso.configs.default.keyboard_layout.layout = "se"; -} # end file +} diff --git a/home/alisceon/hosts/tower.nix b/home/hosts/alisceon/tower.nix similarity index 94% rename from home/alisceon/hosts/tower.nix rename to home/hosts/alisceon/tower.nix index c95ba2e..5cfbaaf 100644 --- a/home/alisceon/hosts/tower.nix +++ b/home/hosts/alisceon/tower.nix @@ -1,4 +1,4 @@ -{ pkgs, config, hostName, lib, ... }: +{ ... }: { wayland.windowManager.sway.config = { output = { @@ -36,4 +36,4 @@ }; services.espanso.configs.default.keyboard_layout.layout = "us"; -} # end file +} diff --git a/home/modules/programs/chromium.nix b/home/modules/programs/chromium.nix new file mode 100644 index 0000000..4a53d0c --- /dev/null +++ b/home/modules/programs/chromium.nix @@ -0,0 +1,18 @@ +{ ... }: +{ + programs.chromium = { + enable = true; + commandLineArgs = [ + "--enable-features=TouchpadOverscrollHistoryNavigation,VaapiVideoDecoder" + ]; + extensions = [ + { id = "ddkjiahejlhfcafbddmgiahcphecmpfh"; } + { id = "nngceckbapebfimnlniiiahkandclblb"; } + { id = "mdjildafknihdffpkfmmpnpoiajfjnjd"; } + { id = "mnjggcdmjocbbbhaepdhchncahnbgone"; } + { id = "ijcpiojgefnkmcadacmacogglhjdjphj"; } + { id = "kbmfpngjjgdllneeigpgjifpgocmfgmb"; } + { id = "einpaelgookohagofgnnkcfjbkkgepnp"; } + ]; + }; +} diff --git a/home/modules/programs/direnv.nix b/home/modules/programs/direnv.nix new file mode 100644 index 0000000..284030e --- /dev/null +++ b/home/modules/programs/direnv.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + programs.direnv = { + enable = true; + silent = true; + nix-direnv.enable = true; + }; +} diff --git a/home/modules/programs/discord.nix b/home/modules/programs/discord.nix new file mode 100644 index 0000000..cf04a71 --- /dev/null +++ b/home/modules/programs/discord.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + programs.discord.enable = true; +} diff --git a/home/alisceon/modules/programs/fish.nix b/home/modules/programs/fish.nix similarity index 56% rename from home/alisceon/modules/programs/fish.nix rename to home/modules/programs/fish.nix index d511013..9437475 100644 --- a/home/alisceon/modules/programs/fish.nix +++ b/home/modules/programs/fish.nix @@ -1,11 +1,10 @@ -{ pkgs, config, hostName, lib, ... }: +{ ... }: { programs.fish = { enable = false; - # Disable greeting interactiveShellInit = '' set fish_greeting ''; preferAbbrs = true; - }; # end programs.fish -} # end file + }; +} diff --git a/home/modules/programs/foot.nix b/home/modules/programs/foot.nix new file mode 100644 index 0000000..e0ebbb7 --- /dev/null +++ b/home/modules/programs/foot.nix @@ -0,0 +1,15 @@ +{ ... }: +{ + programs.foot = { + enable = true; + server.enable = true; + settings = { + main = { + app-id = "footclient"; + workers = 32; + }; + bell.system = "no"; + scrollback.lines = 100000; + }; + }; +} diff --git a/home/alisceon/modules/programs/git.nix b/home/modules/programs/git.nix similarity index 62% rename from home/alisceon/modules/programs/git.nix rename to home/modules/programs/git.nix index 9ce2564..9a107b1 100644 --- a/home/alisceon/modules/programs/git.nix +++ b/home/modules/programs/git.nix @@ -1,4 +1,4 @@ -{ pkgs, config, hostName, lib, ... }: +{ ... }: { programs.git = { enable = true; @@ -7,8 +7,8 @@ name = "alisceon"; email = "alisceon@protonmail.com"; }; - push = { autoSetupRemote = true; }; + push.autoSetupRemote = true; init.defaultBranch = "main"; }; - }; # end programs.git -} # end file + }; +} diff --git a/home/alisceon/modules/programs/kitty.nix b/home/modules/programs/kitty.nix similarity index 68% rename from home/alisceon/modules/programs/kitty.nix rename to home/modules/programs/kitty.nix index 2e10274..886a477 100644 --- a/home/alisceon/modules/programs/kitty.nix +++ b/home/modules/programs/kitty.nix @@ -1,4 +1,4 @@ -{ pkgs, config, hostName, lib, ... }: +{ ... }: { programs.kitty = { enable = true; @@ -7,5 +7,5 @@ enable_audio_bell = false; window_padding_width = 2; }; - }; # end programs.kitty -} # end file + }; +} diff --git a/home/modules/programs/nushell.nix b/home/modules/programs/nushell.nix new file mode 100644 index 0000000..919543e --- /dev/null +++ b/home/modules/programs/nushell.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + programs.nushell = { + enable = false; + configFile.source = ../../conf/config.nu; + }; +} diff --git a/home/modules/programs/rofi.nix b/home/modules/programs/rofi.nix new file mode 100644 index 0000000..20a2971 --- /dev/null +++ b/home/modules/programs/rofi.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +let + commands = import ../../../lib/commands.nix { inherit pkgs; }; + inherit (commands) term; +in +{ + programs.rofi = { + enable = true; + package = pkgs.rofi-unwrapped; + terminal = term; + }; +} diff --git a/home/alisceon/modules/programs/ssh.nix b/home/modules/programs/ssh.nix similarity index 86% rename from home/alisceon/modules/programs/ssh.nix rename to home/modules/programs/ssh.nix index 67b2b89..0f44954 100644 --- a/home/alisceon/modules/programs/ssh.nix +++ b/home/modules/programs/ssh.nix @@ -1,4 +1,4 @@ -{ pkgs, config, hostName, lib, ... }: +{ ... }: { programs.ssh = { enable = true; @@ -38,9 +38,7 @@ hostname = "10.40.0.2"; user = "pi"; }; - "nuc" = { - hostname = "nuc.home.the.malice.zone"; - }; + "nuc".hostname = "nuc.home.the.malice.zone"; "tsla-exporter-bridge" = { hostname = "alma02.lab.the.malice.zone"; user = "root"; @@ -49,9 +47,7 @@ hostname = "alma03.lab.the.malice.zone"; user = "root"; }; - "tsla-nixos" = { - hostname = "tesla-nixos.lab.the.malice.zone"; - }; + "tsla-nixos".hostname = "tesla-nixos.lab.the.malice.zone"; "tsla-backups" = { hostname = "backups.lab.the.malice.zone"; user = "root"; @@ -70,6 +66,6 @@ addKeysToAgent = "yes"; hostname = "electra.home.the.malice.zone"; }; - }; # end matchBlocks - }; # end programs.ssh -} # end file + }; + }; +} diff --git a/home/alisceon/modules/programs/swaylock.nix b/home/modules/programs/swaylock.nix similarity index 56% rename from home/alisceon/modules/programs/swaylock.nix rename to home/modules/programs/swaylock.nix index 4b5a4e1..28784b7 100644 --- a/home/alisceon/modules/programs/swaylock.nix +++ b/home/modules/programs/swaylock.nix @@ -1,10 +1,10 @@ -{ pkgs, config, hostName, lib, ... }: +{ ... }: { programs.swaylock = { enable = true; settings = { ignore-empty-password = true; indicator-caps-lock = true; - }; # end settings - }; # end programs.swaylock -} # end file + }; + }; +} diff --git a/home/modules/programs/vscode.nix b/home/modules/programs/vscode.nix new file mode 100644 index 0000000..f36eac7 --- /dev/null +++ b/home/modules/programs/vscode.nix @@ -0,0 +1,44 @@ +{ pkgs, ... }: +{ + programs.vscode = { + enable = true; + package = pkgs.vscodium.fhsWithPackages ( + ps: with ps; [ git ] + ); + profiles.default = { + userSettings = { + "python.languageServer" = "None"; + "python.pyrefly.displayTypeErrors" = "force-on"; + "explorer.confirmDelete" = false; + "explorer.confirmDragAndDrop" = false; + "explorer.confirmPasteNative" = false; + "git.confirmSync" = false; + }; + extensions = [ + pkgs.vscode-extensions.ms-python.python + pkgs.vscode-extensions.ms-python.debugpy + pkgs.vscode-extensions.ms-vscode.cpptools + pkgs.vscode-extensions.jnoortheen.nix-ide + ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ + { + name = "xonsh"; + publisher = "jnoortheen"; + version = "0.3.3"; + hash = "sha256-EdAjVzqvbiSm/hL/SeJIlfY1QocpQPyzv4RV84t4bbg="; + } + { + name = "pyrefly"; + publisher = "meta"; + version = "0.52.0"; + hash = "sha256-vheW8D2jy3aTpAR/jsgw8Khj1z08GGmRaeYvL+UOXSI="; + } + { + name = "chatgpt"; + publisher = "openai"; + version = "0.5.74"; + hash = "sha256-yR9oR3w4AkoWaQDPwSaQtrKL6IcXANaMfFiw6K/b5o0="; + } + ]; + }; + }; +} diff --git a/home/modules/programs/waybar.nix b/home/modules/programs/waybar.nix new file mode 100644 index 0000000..0bb3e9c --- /dev/null +++ b/home/modules/programs/waybar.nix @@ -0,0 +1,104 @@ +{ pkgs, ... }: +let + commands = import ../../../lib/commands.nix { inherit pkgs; }; + inherit (commands) uwsm term; +in +{ + programs.waybar = { + enable = true; + systemd = { + enable = true; + target = "graphical-session.target"; + }; + settings.mainBar = { + layer = "bottom"; + position = "top"; + height = 28; + spacing = 0; + modules-left = [ "sway/workspaces" ]; + modules-center = [ "sway/window" ]; + modules-right = [ + "tray" + "idle_inhibitor" + "network" + "bluetooth" + "pulseaudio" + "battery" + "sway/language" + "clock" + ]; + "sway/workspaces" = { + on-click = "activate"; + sort-by-number = true; + format = "{value}"; + }; + "sway/window".max-length = 64; + tray = { + icon-size = 24; + spacing = 8; + }; + idle_inhibitor = { + format = "| {icon}"; + start-activated = true; + format-icons = { + activated = "đŸĢ¨"; + deactivated = "😴"; + }; + }; + "sway/language" = { + format = "| {flag}"; + tooltip-format = "{long}"; + }; + clock = { + interval = 60; + tooltip = true; + format = "| {:%H:%M} "; + tooltip-format = "{:%Y-%m-%d}"; + }; + battery = { + interval = 60; + format = "| {icon}{capacity}%"; + format-charging = "| {icon}⚡{capacity}%"; + format-plugged = "| {icon}🔌{capacity}%"; + states = { + critical = 10; + warning = 20; + good = 100; + full = 100; + over = 101; + }; + format-icons = [ "đŸĒĢ" "đŸĒĢ" "🔋" "🔋" "🔋" ]; + }; + network = { + tooltip-format = "{ifname} = {ipaddr}/{cidr}"; + format-wifi = "| ᯤ"; + format-ethernet = "| ⇄"; + format-linked = "| 🔗"; + format-disconnected = "| â›“ī¸â€đŸ’Ĩ"; + interval = 15; + on-click = "${uwsm} ${term} -e nmtui"; + }; + bluetooth = { + format-connected = "| ᛒ"; + format-on = "| ᚧ"; + format-disabled = ""; + format-no-controller = ""; + interval = 15; + on-click = "${uwsm} ${term} -e bluetui"; + }; + pulseaudio = { + format = "| 🔊{volume}%"; + format-muted = "| 🔈0%"; + format-bluetooth = "| 🎧{volume}%"; + on-click = "${uwsm} pavucontrol"; + }; + }; + style = '' + button { + box-shadow: inset 0 -8px transparent; + border: none; + border-radius: 0; + } + ''; + }; +} diff --git a/home/modules/services/espanso.nix b/home/modules/services/espanso.nix new file mode 100644 index 0000000..e087df5 --- /dev/null +++ b/home/modules/services/espanso.nix @@ -0,0 +1,54 @@ +{ pkgs, repoRoot, ... }: +{ + services.espanso = { + enable = true; + waylandSupport = true; + configs.default = { + toggle_key = "OFF"; + preserve_clipboard = true; + show_notifications = true; + keyboard_layout.layout = "se"; + }; + matches = { + base.matches = [ + { + trigger = ":ip "; + replace = "{{pubip}} "; + } + { + trigger = ":gw2hs "; + replace = "Full Homestead ^w^ "; + } + { + regex = ":format (?P\\S+) (?P\\S+) "; + replace = "{{format_text}} "; + vars = [ + { + name = "format_text"; + type = "shell"; + params.cmd = "${pkgs.python3}/bin/python3 ${repoRoot}/util/format_text.py $ESPANSO_ALPHABET $ESPANSO_TEXT"; + } + ]; + } + { + regex = ";;(?P\\S+) "; + replace = "{{emoji}} "; + vars = [ + { + name = "emoji"; + type = "shell"; + params.cmd = "${pkgs.python3}/bin/python3 ${repoRoot}/util/get_emoji.py $ESPANSO_EMNAME"; + } + ]; + } + ]; + global_vars.global_vars = [ + { + name = "pubip"; + type = "shell"; + params.cmd = "curl -s https://ifconfig.me"; + } + ]; + }; + }; +} diff --git a/home/alisceon/modules/services/gnome-keyring.nix b/home/modules/services/gnome-keyring.nix similarity index 70% rename from home/alisceon/modules/services/gnome-keyring.nix rename to home/modules/services/gnome-keyring.nix index df768b5..6327f61 100644 --- a/home/alisceon/modules/services/gnome-keyring.nix +++ b/home/modules/services/gnome-keyring.nix @@ -1,4 +1,4 @@ -{ pkgs, config, hostName, lib, ... }: +{ ... }: { services.gnome-keyring = { enable = true; @@ -8,4 +8,4 @@ "secrets" ]; }; -} # end file +} diff --git a/home/alisceon/modules/services/mako.nix b/home/modules/services/mako.nix similarity index 76% rename from home/alisceon/modules/services/mako.nix rename to home/modules/services/mako.nix index d3ca70f..f961f7f 100644 --- a/home/alisceon/modules/services/mako.nix +++ b/home/modules/services/mako.nix @@ -1,4 +1,4 @@ -{ pkgs, config, hostName, lib, ... }: +{ ... }: { services.mako = { enable = true; @@ -14,6 +14,6 @@ layer = "overlay"; margin = 10; markup = true; - }; #end settings - }; # end services.mako -} # end file + }; + }; +} diff --git a/home/alisceon/modules/services/swayidle.nix b/home/modules/services/swayidle.nix similarity index 83% rename from home/alisceon/modules/services/swayidle.nix rename to home/modules/services/swayidle.nix index 68ae998..6ec612c 100644 --- a/home/alisceon/modules/services/swayidle.nix +++ b/home/modules/services/swayidle.nix @@ -1,6 +1,6 @@ -{ pkgs, config, hostName, lib, ... }: +{ pkgs, ... }: let - commands = import ../../lib/commands.nix { inherit pkgs; }; + commands = import ../../../lib/commands.nix { inherit pkgs; }; inherit (commands) notify lock display; in { @@ -24,7 +24,7 @@ in timeout = 600; command = "${pkgs.systemd}/bin/systemctl suspend"; } - ]; # end timeouts + ]; events = [ { event = "before-sleep"; @@ -42,6 +42,6 @@ in event = "unlock"; command = display "on"; } - ]; # end events - }; # end services.swayidle -} # end file + ]; + }; +} diff --git a/home/modules/services/syncthing.nix b/home/modules/services/syncthing.nix new file mode 100644 index 0000000..26a7b27 --- /dev/null +++ b/home/modules/services/syncthing.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + services.syncthing.enable = true; +} diff --git a/home/alisceon/modules/wm/gnome/dconf.nix b/home/modules/wm/gnome/dconf.nix similarity index 94% rename from home/alisceon/modules/wm/gnome/dconf.nix rename to home/modules/wm/gnome/dconf.nix index 5d52ebb..6397213 100644 --- a/home/alisceon/modules/wm/gnome/dconf.nix +++ b/home/modules/wm/gnome/dconf.nix @@ -1,4 +1,5 @@ -{ pkgs, config, hostName, lib, ... }: { +{ pkgs, ... }: +{ dconf = { enable = true; settings = { @@ -10,9 +11,7 @@ picture-uri = "file:///home/alisceon/Pictures/system/bg.png"; picture-uri-dark = "file:///home/alisceon/Pictures/system/bg.png"; }; - "org/gnome/mutter" = { - auto-maximize = true; - }; + "org/gnome/mutter".auto-maximize = true; "org/gnome/desktop/interface" = { accent-color = "red"; color-scheme = "prefer-dark"; @@ -31,7 +30,6 @@ }; "org/gnome/shell/keybindings" = { show-screenshot-ui = [ "s" ]; - }; "org/gnome/desktop/wm/keybindings" = { switch-to-workspace-1 = [ "1" ]; @@ -82,6 +80,6 @@ use-system-font = false; use-theme-colors = true; }; - }; # end settings - }; # end dconf -} # end file + }; + }; +} diff --git a/home/modules/wm/gnome/default.nix b/home/modules/wm/gnome/default.nix new file mode 100644 index 0000000..1784139 --- /dev/null +++ b/home/modules/wm/gnome/default.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + imports = [ + ./dconf.nix + ]; +} diff --git a/home/alisceon/modules/wm/sway/default.nix b/home/modules/wm/sway/default.nix similarity index 67% rename from home/alisceon/modules/wm/sway/default.nix rename to home/modules/wm/sway/default.nix index 8c37b32..564ce00 100644 --- a/home/alisceon/modules/wm/sway/default.nix +++ b/home/modules/wm/sway/default.nix @@ -1,44 +1,42 @@ -{ pkgs, config, hostName, lib, ... }: - let - # shared command aliases - commands = import ../../../lib/commands.nix { inherit pkgs; }; - inherit (commands) uwsm lock term notify nag dmenu espanso; +{ pkgs, repoRoot, ... }: +let + commands = import ../../../../lib/commands.nix { inherit pkgs; }; + inherit (commands) uwsm lock term notify nag dmenu espanso; - # keybinds - key_mod = "Mod4"; - key_mod_misc = "Alt"; - key_left = "Left"; - key_right = "Right"; - key_up = "Up"; - key_down = "Down"; - - in + key_mod = "Mod4"; + key_mod_misc = "Alt"; + key_left = "Left"; + key_right = "Right"; + key_up = "Up"; + key_down = "Down"; +in { imports = [ - "./gtk.nix" - "./xdg.nix" - "../../modules/programs/foot.nix" - "../../modules/programs/rofi.nix" - "../../modules/programs/swaylock.nix" - "../../modules/programs/waybar.nix" - "../../modules/services/espanso.nix" - "../../modules/services/gnome-keyring.nix" - "../../modules/services/mako.nix" - "../../modules/services/swayidle.nix" + ./gtk.nix + ./xdg.nix + ../../programs/foot.nix + ../../programs/rofi.nix + ../../programs/swaylock.nix + ../../programs/waybar.nix + ../../services/espanso.nix + ../../services/gnome-keyring.nix + ../../services/mako.nix + ../../services/swayidle.nix ]; + wayland.windowManager.sway = { enable = true; wrapperFeatures.gtk = true; config = { - modifier = "${key_mod}"; + modifier = key_mod; startup = [ { command = "systemctl --user start libinput-gestures"; } - { command = ''${uwsm} swaybg -m fill -i /home/alisceon/Pictures/system/bg.png'';} + { command = "${uwsm} swaybg -m fill -i /home/alisceon/Pictures/system/bg.png"; } ]; bars = [ ]; input = { "type:keyboard" = { - xkb_options = "fkeys:basic_13-24"; + xkb_options = "fkeys:basic_13-24"; }; "type:touchpad" = { dwt = "enabled"; @@ -58,12 +56,10 @@ xkb_layout = "se,us"; xkb_options = "grp:win_space_toggle"; }; - }; # end input + }; keybindings = { - # Outputs - "F13" = ''exec ${notify} -t 2000 "$(xonsh ~/.nixos_config/util/toggle_mon.xsh)"''; + "F13" = "exec ${notify} -t 2000 \"$(${pkgs.xonsh}/bin/xonsh ${repoRoot}/util/toggle_mon.xsh)\""; - # Workspaces "${key_mod}+f" = "fullscreen"; "${key_mod}+Shift+f" = "floating toggle"; @@ -100,7 +96,6 @@ "${key_mod}+Ctrl+9" = "move container to workspace number 9"; "${key_mod}+Ctrl+0" = "move container to scratchpad"; - # Layout "${key_mod}+b" = "splith"; "${key_mod}+v" = "splitv"; @@ -108,19 +103,16 @@ "${key_mod}+w" = "layout tabbed"; "${key_mod}+e" = "layout toggle split"; - # Focus "${key_mod}+Ctrl+${key_left}" = "focus left"; "${key_mod}+Ctrl+${key_right}" = "focus right"; "${key_mod}+Ctrl+${key_down}" = "focus down"; "${key_mod}+Ctrl+${key_up}" = "focus up"; - # Move "${key_mod}+Shift+${key_left}" = "move left"; "${key_mod}+Shift+${key_down}" = "move down"; "${key_mod}+Shift+${key_up}" = "move up"; "${key_mod}+Shift+${key_right}" = "move right"; - # Sparkly alt-tab "${key_mod}+Tab" = "focus right"; "${key_mod}+Shift+Tab" = "focus left"; "${key_mod}+Ctrl+Tab" = "move right"; @@ -128,55 +120,49 @@ "${key_mod}+${key_mod_misc}+Tab" = "workspace next"; "${key_mod}+${key_mod_misc}+Shift+Tab" = "workspace prev"; - # System - "Mod4+space" = ''exec ${notify} -t 2000 "$(xonsh ~/.nixos_config/util/get_xkb.xsh)"''; + "Mod4+space" = "exec ${notify} -t 2000 \"$(${pkgs.xonsh}/bin/xonsh ${repoRoot}/util/get_xkb.xsh)\""; "${key_mod}+Shift+r" = "reload"; "${key_mod}+Ctrl+r" = "restart"; "${key_mod}+Shift+Backspace" = "exec ${nag} -m 'TuneD profiles:' -Z 'Performance' 'tuned-adm profile accelerator-performance' -Z 'Balanced' 'tuned-adm profile balanced' -Z 'Power Save' 'tuned-adm profile powersave'"; "${key_mod}+Shift+q" = "kill"; "Alt+F4" = "kill"; - # Locking and idle "${key_mod}+L" = "exec ${lock}"; "${key_mod}+Escape" = "exec ${nag} -m 'Shutdown options:' -Z 'Power Off' 'systemctl poweroff' -Z 'Reboot' 'systemctl reboot' -Z 'Logout' 'swaymsg exit'"; - # Apps - "${key_mod}+Return" = ''exec "${uwsm} ${term}"''; - "${key_mod}+d" = ''exec "${uwsm} ${dmenu} -show drun"''; - "${key_mod}+s" = ''exec "${uwsm} ${espanso} search"''; - "${key_mod}+Shift+e" = ''exec "${uwsm} ${espanso} toggle"''; - + "${key_mod}+Return" = "exec ${uwsm} ${term}"; + "${key_mod}+d" = "exec ${uwsm} ${dmenu} -show drun"; + "${key_mod}+s" = "exec ${uwsm} ${espanso} search"; + "${key_mod}+Shift+e" = "exec ${uwsm} ${espanso} toggle"; - # Screenshot region "${key_mod}+Shift+s" = "exec grimshot savecopy area"; "${key_mod}+Ctrl+s" = "exec grimshot savecopy output"; - # media keys - "XF86AudioRaiseVolume" = "exec 'pactl set-sink-volume @DEFAULT_SINK@ +3%'"; - "XF86AudioLowerVolume" = "exec 'pactl set-sink-volume @DEFAULT_SINK@ -3%'"; - "XF86AudioMute" = "exec 'pactl set-sink-mute @DEFAULT_SINK@ toggle'"; - "XF86AudioPlay" = "exec 'playerctl play-pause'"; - "${key_mod}+XF86AudioPlay" = ''exec ${notify} -t 2000 "$(xonsh ~/.nixos_config/util/swap_sound_device.xsh)"''; + "XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +3%"; + "XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -3%"; + "XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; + "XF86AudioPlay" = "exec playerctl play-pause"; + "${key_mod}+XF86AudioPlay" = "exec ${notify} -t 2000 \"$(${pkgs.xonsh}/bin/xonsh ${repoRoot}/util/swap_sound_device.xsh)\""; "XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 9"; "XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 3"; - }; # end keybindings + }; window = { titlebar = false; commands = [ { criteria = { all = true; }; command = "inhibit_idle fullscreen"; } ]; - }; # end window - assigns = { - "1" = [{app_id = "chromium";}]; - "2" = [{class = "steam";}]; - "3" = []; - "4" = [{class = "VSCodium";}]; - "5" = [{app_id = "obsidian";}]; - "6" = []; - "7" = []; - "8" = [{app_id = "discord";}]; - "9" = [{app_id = "signal";}]; }; - }; # end config - }; # end wayland.windowManager.sway -} # end file + assigns = { + "1" = [ { app_id = "chromium"; } ]; + "2" = [ { class = "steam"; } ]; + "3" = [ ]; + "4" = [ { class = "VSCodium"; } ]; + "5" = [ { app_id = "obsidian"; } ]; + "6" = [ ]; + "7" = [ ]; + "8" = [ { app_id = "discord"; } ]; + "9" = [ { app_id = "signal"; } ]; + }; + }; + }; +} diff --git a/home/alisceon/modules/wm/sway/gtk.nix b/home/modules/wm/sway/gtk.nix similarity index 67% rename from home/alisceon/modules/wm/sway/gtk.nix rename to home/modules/wm/sway/gtk.nix index 1d5f545..d4845b0 100644 --- a/home/alisceon/modules/wm/sway/gtk.nix +++ b/home/modules/wm/sway/gtk.nix @@ -1,4 +1,4 @@ -{ pkgs, config, hostName, lib, ... }: +{ ... }: { gtk = { enable = true; @@ -6,4 +6,4 @@ gtk3.enable = true; gtk4.enable = true; }; -} # end file +} diff --git a/home/alisceon/modules/wm/sway/xdg.nix b/home/modules/wm/sway/xdg.nix similarity index 93% rename from home/alisceon/modules/wm/sway/xdg.nix rename to home/modules/wm/sway/xdg.nix index 1758082..af690bb 100644 --- a/home/alisceon/modules/wm/sway/xdg.nix +++ b/home/modules/wm/sway/xdg.nix @@ -1,6 +1,6 @@ -{ pkgs, config, hostName, lib, ... }: +{ pkgs, ... }: let - commands = import ../../../lib/commands.nix { inherit pkgs; }; + commands = import ../../../../lib/commands.nix { inherit pkgs; }; inherit (commands) swaymsg lock; in { @@ -44,7 +44,7 @@ in "application/x-web-app-manifest+json" = [ "${pkgs.chromium}/share/applications/chromium.desktop" ]; "application/xml-dtd" = [ "${pkgs.chromium}/share/applications/chromium.desktop" ]; - "image/*" = [ "${pkgs.loupe}/share/applications/org.gnome.Loupe.desktop.desktop" ]; + "image/*" = [ "${pkgs.loupe}/share/applications/org.gnome.Loupe.desktop" ]; }; }; }; @@ -53,4 +53,4 @@ in GNOME_DESKTOP_SESSION_ID = "999"; SHELL_THICCNESS = "LOW"; }; -} # end file +} diff --git a/home/profiles/base.nix b/home/profiles/base.nix new file mode 100644 index 0000000..9f6a5b6 --- /dev/null +++ b/home/profiles/base.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + imports = [ + ../users/alisceon/default.nix + ]; +} diff --git a/home/profiles/server.nix b/home/profiles/server.nix new file mode 100644 index 0000000..52c14b8 --- /dev/null +++ b/home/profiles/server.nix @@ -0,0 +1,3 @@ +{ ... }: +{ +} diff --git a/home/alisceon/workstation.nix b/home/profiles/workstation.nix similarity index 64% rename from home/alisceon/workstation.nix rename to home/profiles/workstation.nix index 4147f77..1f1b3a1 100644 --- a/home/alisceon/workstation.nix +++ b/home/profiles/workstation.nix @@ -1,19 +1,16 @@ -{ pkgs, config, hostName, lib, ... }: { +{ pkgs, lib, repoRoot, ... }: +{ imports = [ - ./modules/programs/chromium.nix - ./modules/programs/discord.nix - ./modules/programs/vscode.nix - ./modules/services/syncthing.nix + ../modules/programs/chromium.nix + ../modules/programs/discord.nix + ../modules/programs/vscode.nix + ../modules/services/syncthing.nix ]; stylix.enableReleaseChecks = false; - # obsidian special case - # programs.obsidian.enable = true; - # overide broken config - xdg.configFile."obsidian/obsidian.json".source = lib.mkForce ../conf/obsidian.json; - # nixpkgs config - xdg.configFile."nixpkgs/config.nix".source = ../conf/config.nix; + xdg.configFile."obsidian/obsidian.json".source = lib.mkForce ../conf/obsidian.json; + xdg.configFile."nixpkgs/config.nix".source = ../conf/config.nix; xdg = { enable = true; @@ -33,9 +30,9 @@ chromium-dailies = { name = "Chromium Dailies"; genericName = "Web Browser (with dailies)"; - exec = "xonsh /home/alisceon/.nixos_config/util/open_dailies.xsh"; + exec = "${pkgs.xonsh}/bin/xonsh ${repoRoot}/util/open_dailies.xsh"; terminal = false; }; }; }; -} # end file +} diff --git a/home/root/base.nix b/home/root/base.nix deleted file mode 100644 index 60e690e..0000000 --- a/home/root/base.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - imports = [ - ./default.nix - ]; -} # end file diff --git a/home/root/default.nix b/home/root/default.nix deleted file mode 100644 index 71d3e9a..0000000 --- a/home/root/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, config, hostName, lib, ... }: -{ - home.username = "root"; - home.homeDirectory = "/root"; - home.stateVersion = "24.05"; - programs = { - git = { - enable = true; - extraConfig.safe.directory = "/home/alisceon/.nixos_config"; - }; # end git - }; # end programs -} # end file diff --git a/home/users/alisceon/default.nix b/home/users/alisceon/default.nix new file mode 100644 index 0000000..a08750f --- /dev/null +++ b/home/users/alisceon/default.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: +{ + imports = [ + ../../modules/programs/direnv.nix + ../../modules/programs/git.nix + ../../modules/programs/ssh.nix + ]; + + home.username = "alisceon"; + home.homeDirectory = "/home/alisceon"; + home.stateVersion = "24.05"; + manual.manpages.enable = true; + + xdg.configFile."nixpkgs/config.nix".source = ../../conf/config.nix; + xdg.configFile."xonsh/theo.py".source = ../../conf/xonsh/theo.py; + xdg.configFile."xonsh/kittycatsay.py".source = ../../conf/xonsh/kittycatsay.py; + + # Ensure fish exists for the completer backend. + home.packages = [ pkgs.fish ]; +} diff --git a/home/users/root/default.nix b/home/users/root/default.nix new file mode 100644 index 0000000..9250c63 --- /dev/null +++ b/home/users/root/default.nix @@ -0,0 +1,11 @@ +{ repoLocalPath, ... }: +{ + home.username = "root"; + home.homeDirectory = "/root"; + home.stateVersion = "24.05"; + + programs.git = { + enable = true; + extraConfig.safe.directory = repoLocalPath; + }; +} diff --git a/home/wm/sway.nix b/home/wm/sway.nix deleted file mode 100644 index 6305b22..0000000 --- a/home/wm/sway.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ ... }: -{ - imports = [ - ../alisceon/modules/wm/sway/default.nix - ../alisceon/modules/wm/sway/gtk.nix - ../alisceon/modules/wm/sway/xdg.nix - - ../alisceon/modules/programs/foot.nix - ../alisceon/modules/programs/kitty.nix - ../alisceon/modules/programs/rofi.nix - ../alisceon/modules/programs/swaylock.nix - ../alisceon/modules/programs/waybar.nix - - ../alisceon/modules/services/espanso.nix - ../alisceon/modules/services/gnome-keyring.nix - ../alisceon/modules/services/mako.nix - ]; -} # end file diff --git a/hosts/base.nix b/hosts/base.nix deleted file mode 100644 index 60e690e..0000000 --- a/hosts/base.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - imports = [ - ./default.nix - ]; -} # end file diff --git a/hosts/common/server.nix b/hosts/common/server.nix deleted file mode 100644 index 4731834..0000000 --- a/hosts/common/server.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config, pkgs, ... }: - -{ - system.autoUpgrade = { - allowReboot = true; - }; # end system.autoUpgrade - services = { - openssh = { - enable = true; - permitRootLogin = "no"; - }; # end openssh - }; # end services - - environment = { - systemPackages = with pkgs; [ - devenv - direnv - ]; # end systemPackages - }; # end environment -} # end file diff --git a/hosts/common/wm/sway.nix b/hosts/common/wm/sway.nix deleted file mode 100644 index 39799e8..0000000 --- a/hosts/common/wm/sway.nix +++ /dev/null @@ -1,108 +0,0 @@ -{ config, pkgs, lib, hostName, ... }: -{ - environment.systemPackages = with pkgs; [ - pavucontrol - libinput - libinput-gestures - libnotify - wmctrl - playerctl - - # MIME utilities - xdg-utils - shared-mime-info - - # GNOME utilities - libsecret # Keyring backend - gnome-text-editor - loupe - evince - seahorse - nautilus - ]; - - # enable Sway window manager - programs = { - sway = { - enable = true; - wrapperFeatures.base = true; - wrapperFeatures.gtk = true; - extraOptions = [ - "--unsupported-gpu" - ]; - extraPackages = with pkgs; [ - swayidle # idle management - swaylock # screen locker - swaybg # wallpaper setting tool - grim # screenshot tool - slurp # selection tool for screenshots - wl-clipboard # clipboard support (mostly for grim/slurp) - pulseaudio # pulseaudio support - sway-contrib.grimshot # screenshot tool - foot # fast and lightweight terminal emulator - kitty # sparkly terminal emulator - dotool # tool to send keyboard/mouse input to wayland apps - mako # notification system developed by swaywm maintainer - espanso-wayland # text expander - ]; - }; # end sway - uwsm = { # responsible for creating xdg-portal and systemd insteraction for sway - enable = true; - waylandCompositors = { - sway = { - prettyName = "Sway"; - comment = "Sway compositor managed by UWSM"; - binPath = "${pkgs.sway}/bin/sway"; - extraArgs = [ "--unsupported-gpu" ]; - }; - }; - }; # end uwsm - light = { - enable = true; - }; # end light - dconf.enable = true; - seahorse.enable = true; - }; # end programs - security = { - polkit.enable = true; - pam.services = { - greetd.enableGnomeKeyring = true; - #greetd-password.enableGnomeKeyring = true; - login.enableGnomeKeyring = true; - swaylock = { - text = '' - auth sufficient pam_unix.so try_first_pass likeauth nullok - auth sufficient pam_fprintd.so - auth include login - ''; - }; # end swaylock - }; # end pam.services - }; # end security - services = { - greetd = { - enable = true; - settings = { - initial_session = { - command = "uwsm start -- sway-uwsm.desktop"; - user = "alisceon"; - }; # end initial_session - default_session = { - command = "${pkgs.tuigreet}/bin/tuigreet --time --cmd 'uwsm start -- sway-uwsm.desktop' --remember --asterisks''"; - user = "greeter"; - }; # end initial_session - }; # end settings - }; # end greetd - logind = { - settings = { - Login = { - HandleLidSwitch = "suspend"; - HandleLidSwitchExternalPower = "suspend"; - }; - }; - }; # end logind - dbus.packages = [ pkgs.seahorse pkgs.gnome-keyring pkgs.gcr ]; - gnome.gcr-ssh-agent.enable = true; # SSH key management via gnome keyring - gvfs.enable = true; # some support for nautilus operations - }; # end services - users.users.alisceon.extraGroups = [ "video" "input" ]; # input group required for libinput-gestures -} \ No newline at end of file diff --git a/hosts/default.nix b/hosts/default.nix deleted file mode 100644 index 2298c2a..0000000 --- a/hosts/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - imports = [ - ./common/default.nix - ]; -} # end file diff --git a/hosts/electra/configuration.nix b/hosts/electra/configuration.nix deleted file mode 100644 index 3bd45da..0000000 --- a/hosts/electra/configuration.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ config, pkgs, ... }: - -{ - imports = - [ ./hardware-configuration.nix ]; - networking.hostName = "electra"; - boot = { - loader.systemd-boot.enable = true; - loader.efi.canTouchEfiVariables = true; - initrd = { - enable = true; - luks.devices."luks-654125f4-7b26-408d-b1b5-d31648ec8770".device = "/dev/disk/by-uuid/654125f4-7b26-408d-b1b5-d31648ec8770"; - verbose = false; - }; - #resumeDevice = "/dev/disk/by-uuid/c49249b9-0d68-44af-97e0-e399c8409408"; - }; # end boot - environment.systemPackages = [ - pkgs.bluetui - pkgs.wakeonlan - ]; - systemd.services = { - fprintd = { - wantedBy = [ "multi-user.target" ]; - serviceConfig.Type = "simple"; - }; - }; # end systemd.services - services = { - fprintd = { - enable = true; - tod.enable = true; - tod.driver = pkgs.libfprint-2-tod1-goodix; - }; # end fprintd - tuned = { - enable = true; - }; # end tuned - }; # end services - hardware = { - bluetooth = { - enable = true; - powerOnBoot = true; - }; # end bluetooth - }; # end hardware -} # end file diff --git a/hosts/hosts/electra.nix b/hosts/hosts/electra.nix deleted file mode 100644 index 59f212e..0000000 --- a/hosts/hosts/electra.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - imports = [ - ../electra/configuration.nix - ]; -} # end file diff --git a/hosts/hosts/nuc.nix b/hosts/hosts/nuc.nix deleted file mode 100644 index 43a83d6..0000000 --- a/hosts/hosts/nuc.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - imports = [ - ../nuc/configuration.nix - ]; -} # end file diff --git a/hosts/hosts/tesla-nixos.nix b/hosts/hosts/tesla-nixos.nix deleted file mode 100644 index 907ef89..0000000 --- a/hosts/hosts/tesla-nixos.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - imports = [ - ../tesla-nixos/configuration.nix - ]; -} # end file diff --git a/hosts/hosts/tower.nix b/hosts/hosts/tower.nix deleted file mode 100644 index d07dea1..0000000 --- a/hosts/hosts/tower.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - imports = [ - ../tower/configuration.nix - ]; -} # end file diff --git a/hosts/modules/stylix.nix b/hosts/modules/stylix.nix deleted file mode 100644 index 5efaf2e..0000000 --- a/hosts/modules/stylix.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - imports = [ - ../common/stylix.nix - ]; -} # end file diff --git a/hosts/modules/wm/gnome/default.nix b/hosts/modules/wm/gnome/default.nix deleted file mode 100644 index 00f6f21..0000000 --- a/hosts/modules/wm/gnome/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - imports = [ - ../../../common/wm/gnome.nix - ]; -} # end file diff --git a/hosts/modules/wm/sway/default.nix b/hosts/modules/wm/sway/default.nix deleted file mode 100644 index f37f1ea..0000000 --- a/hosts/modules/wm/sway/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - imports = [ - ../../../common/wm/sway.nix - ]; -} # end file diff --git a/hosts/nuc/configuration.nix b/hosts/nuc/configuration.nix deleted file mode 100644 index 5504a34..0000000 --- a/hosts/nuc/configuration.nix +++ /dev/null @@ -1,65 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - environment.systemPackages = with pkgs; [ - wakeonlan - ]; - security.sudo.wheelNeedsPassword = false; - imports = - [ ./hardware-configuration.nix ]; - networking.hostName = "nuc"; - boot.initrd.enable = true; - boot.loader = { - systemd-boot = { - enable = true; - }; # end loader.systemd-boot - }; # end boot - virtualisation = { - oci-containers = { - containers = { - }; # end containers - }; # end oci-containers - }; # end virtualisation - networking.firewall.allowedTCPPorts = [ - 53 - 80 - 443 - ]; - networking.firewall.allowedUDPPorts = [ - 53 - ]; - systemd = { - timers = { - "autowin" = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnCalendar = "Wed *-*-21..28 02:00:00"; - Unit = "autowin.service"; - }; - }; - }; # end timers - - services = { - "autowin" = { - script = '' - ${pkgs.python3Packages.python}/bin/python /home/alisceon/.nixos_config/util/wol_man.py autowin - ''; - serviceConfig = { - Type = "oneshot"; - TimeoutStartSec = "3600"; - User = "alisceon"; - }; - }; # end "hello-world" - }; # end services - }; # end systemd - virtualisation.oci-containers.containers = { - isponsorblocktv = { - image = "ghcr.io/dmunozv04/isponsorblocktv:latest"; - autoStart = true; - volumes = [ - "/home/alisceon/isponsorblocktv:/app/data" - ]; - }; # end isponsorblocktv - }; -} # end file - diff --git a/hosts/server.nix b/hosts/server.nix deleted file mode 100644 index 9f9f72a..0000000 --- a/hosts/server.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - imports = [ - ./common/server.nix - ]; -} # end file diff --git a/hosts/workstation.nix b/hosts/workstation.nix deleted file mode 100644 index 48d9422..0000000 --- a/hosts/workstation.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: -{ - imports = [ - ./common/workstation.nix - ]; -} # end file diff --git a/home/alisceon/lib/commands.nix b/lib/commands.nix similarity index 100% rename from home/alisceon/lib/commands.nix rename to lib/commands.nix diff --git a/nixos/hosts/electra/configuration.nix b/nixos/hosts/electra/configuration.nix new file mode 100644 index 0000000..6de485a --- /dev/null +++ b/nixos/hosts/electra/configuration.nix @@ -0,0 +1,40 @@ +{ pkgs, ... }: +{ + imports = [ ./hardware-configuration.nix ]; + + networking.hostName = "electra"; + + boot = { + loader.systemd-boot.enable = true; + loader.efi.canTouchEfiVariables = true; + initrd = { + enable = true; + luks.devices."luks-654125f4-7b26-408d-b1b5-d31648ec8770".device = "/dev/disk/by-uuid/654125f4-7b26-408d-b1b5-d31648ec8770"; + verbose = false; + }; + }; + + environment.systemPackages = [ + pkgs.bluetui + pkgs.wakeonlan + ]; + + systemd.services.fprintd = { + wantedBy = [ "multi-user.target" ]; + serviceConfig.Type = "simple"; + }; + + services = { + fprintd = { + enable = true; + tod.enable = true; + tod.driver = pkgs.libfprint-2-tod1-goodix; + }; + tuned.enable = true; + }; + + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + }; +} diff --git a/hosts/electra/hardware-configuration.nix b/nixos/hosts/electra/hardware-configuration.nix similarity index 100% rename from hosts/electra/hardware-configuration.nix rename to nixos/hosts/electra/hardware-configuration.nix diff --git a/nixos/hosts/nuc/configuration.nix b/nixos/hosts/nuc/configuration.nix new file mode 100644 index 0000000..1abecfa --- /dev/null +++ b/nixos/hosts/nuc/configuration.nix @@ -0,0 +1,48 @@ +{ pkgs, repoRoot, ... }: +{ + imports = [ ./hardware-configuration.nix ]; + + environment.systemPackages = with pkgs; [ + wakeonlan + ]; + + security.sudo.wheelNeedsPassword = false; + networking.hostName = "nuc"; + + boot.initrd.enable = true; + boot.loader.systemd-boot.enable = true; + + networking.firewall.allowedTCPPorts = [ + 53 + 80 + 443 + ]; + networking.firewall.allowedUDPPorts = [ 53 ]; + + systemd.timers.autowin = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "Wed *-*-21..28 02:00:00"; + Unit = "autowin.service"; + }; + }; + + systemd.services.autowin = { + script = '' + ${pkgs.python3Packages.python}/bin/python ${repoRoot}/util/wol_man.py autowin + ''; + serviceConfig = { + Type = "oneshot"; + TimeoutStartSec = "3600"; + User = "alisceon"; + }; + }; + + virtualisation.oci-containers.containers.isponsorblocktv = { + image = "ghcr.io/dmunozv04/isponsorblocktv:latest"; + autoStart = true; + volumes = [ + "/home/alisceon/isponsorblocktv:/app/data" + ]; + }; +} diff --git a/hosts/nuc/hardware-configuration.nix b/nixos/hosts/nuc/hardware-configuration.nix similarity index 100% rename from hosts/nuc/hardware-configuration.nix rename to nixos/hosts/nuc/hardware-configuration.nix diff --git a/hosts/tesla-nixos/configuration.nix b/nixos/hosts/tesla-nixos/configuration.nix similarity index 51% rename from hosts/tesla-nixos/configuration.nix rename to nixos/hosts/tesla-nixos/configuration.nix index 9e79028..abefb49 100644 --- a/hosts/tesla-nixos/configuration.nix +++ b/nixos/hosts/tesla-nixos/configuration.nix @@ -1,5 +1,4 @@ -{ config, pkgs, lib, ... }: - +{ pkgs, ... }: let modpack = pkgs.fetchPackwizModpack { url = "https://git.malice.zone/alisceon/tfcpack/-/raw/main/pack.toml"; @@ -7,19 +6,18 @@ let }; in { + imports = [ ./hardware-configuration.nix ]; + security.sudo.wheelNeedsPassword = false; - imports = - [ ./hardware-configuration.nix ]; networking.hostName = "tesla-nixos"; - boot.initrd.enable = true; - boot.loader = { - systemd-boot = { - enable = true; - }; # end loader.systemd-boot - }; # end boot - environment.systemPackages = with pkgs; [ - tmux - ]; # end environment.systemPackages + + boot = { + initrd.enable = true; + loader.systemd-boot.enable = true; + }; + + environment.systemPackages = with pkgs; [ tmux ]; + virtualisation.podman.dockerCompat = false; virtualisation.docker = { enable = true; @@ -28,19 +26,17 @@ in dates = "daily"; }; daemon.settings = { - "runtimes" = { - crun = { path = "${pkgs.crun}/bin/crun"; }; - }; - "default-runtime" = "crun"; + runtimes.crun.path = "${pkgs.crun}/bin/crun"; + default-runtime = "crun"; }; }; + networking.firewall.allowedTCPPorts = [ - 8100 #bluemap + 8100 ]; - + services.minecraft-servers = { enable = true; - #managementSystem.systemd-socket.enable = true; eula = true; openFirewall = true; servers.tfcpack = { @@ -48,27 +44,23 @@ in package = pkgs.neoforgeServers.neoforge-1_21_1-21_1_219; autoStart = true; serverProperties = { - "motd" = "TFC Pack - Tesla Nixos"; - "max-players" = "20"; - "view-distance" = "32"; - "level-type" = "tfc\:overworld"; - "spawn-protection" = "0"; - "max-tick-time" = "-1"; + motd = "TFC Pack - Tesla Nixos"; + max-players = "20"; + view-distance = "32"; + level-type = "tfc\\:overworld"; + spawn-protection = "0"; + max-tick-time = "-1"; }; - jvmOpts = [ + jvmOpts = [ "-Xmx24G" "-Xms24G" "-XX:+UseZGC" "-XX:+ZGenerational" ]; - symlinks = { - "mods" = "${modpack}/mods"; - }; # end symlinks - files = { - "config/bluemap/core.conf" = "${modpack}/config/bluemap/core.conf"; - };# end symlinks - }; # end servers.tfcpack - }; # end services.minecraft-servers + symlinks.mods = "${modpack}/mods"; + files."config/bluemap/core.conf" = "${modpack}/config/bluemap/core.conf"; + }; + }; users.users.gitlab-runner = { isNormalUser = true; @@ -78,9 +70,11 @@ in extraGroups = [ "docker" "wheel" ]; group = "gitlab-runner"; }; + users.groups.gitlab-runner = { }; users.groups.docker = { }; - systemd.services."enable-linger-gitlab-runner" = { + + systemd.services.enable-linger-gitlab-runner = { description = "Enable linger for gitlab-runner"; wantedBy = [ "multi-user.target" ]; serviceConfig = { @@ -90,20 +84,16 @@ in }; }; - # GitLab Runner configured to use the local Docker daemon services.gitlab-runner = { enable = true; - services = { - ci-nspawn-docker = { - authenticationTokenConfigFile = "/var/lib/gitlab-runner/token-env"; - executor = "docker"; - dockerImage = "alpine:3"; - dockerPrivileged = true; - dockerVolumes = [ - "/var/lib/gitlab-runner/cache:/cache" - ]; - }; + services.ci-nspawn-docker = { + authenticationTokenConfigFile = "/var/lib/gitlab-runner/token-env"; + executor = "docker"; + dockerImage = "alpine:3"; + dockerPrivileged = true; + dockerVolumes = [ + "/var/lib/gitlab-runner/cache:/cache" + ]; }; }; -} # end file - +} diff --git a/hosts/tesla-nixos/hardware-configuration.nix b/nixos/hosts/tesla-nixos/hardware-configuration.nix similarity index 100% rename from hosts/tesla-nixos/hardware-configuration.nix rename to nixos/hosts/tesla-nixos/hardware-configuration.nix diff --git a/hosts/tower/configuration.nix b/nixos/hosts/tower/configuration.nix similarity index 69% rename from hosts/tower/configuration.nix rename to nixos/hosts/tower/configuration.nix index 67b7c93..f29d284 100644 --- a/hosts/tower/configuration.nix +++ b/nixos/hosts/tower/configuration.nix @@ -1,18 +1,15 @@ -{ config, pkgs, pkgs-unstable, ... }: - +{ config, pkgs, ... }: { - imports = - [ ./hardware-configuration.nix ]; + imports = [ ./hardware-configuration.nix ]; + networking = { hostName = "tower"; - interfaces.enp10s0.wakeOnLan = { - enable = true; - }; - firewall = { - allowedUDPPorts = [ 9 ]; - }; + interfaces.enp10s0.wakeOnLan.enable = true; + firewall.allowedUDPPorts = [ 9 ]; }; + time.hardwareClockInLocalTime = true; + boot = { initrd.enable = true; loader = { @@ -25,20 +22,21 @@ efiDeviceHandle = "FS0"; sortKey = "1"; }; - }; #end windows + }; edk2-uefi-shell = { enable = true; sortKey = "0"; - }; # end edk2-uefi-shell - }; # end systemd-boot - }; # end loader + }; + }; + }; kernelPackages = pkgs.linuxPackages_6_18; - }; # end boot + }; + hardware = { - graphics.enable = true; - graphics.extraPackages = with pkgs; [ - nvidia-vaapi-driver - ]; # end graphics.extraPackages + graphics = { + enable = true; + extraPackages = with pkgs; [ nvidia-vaapi-driver ]; + }; nvidia = { modesetting.enable = true; powerManagement.enable = false; @@ -46,17 +44,19 @@ open = true; nvidiaSettings = true; package = config.boot.kernelPackages.nvidiaPackages.stable; - }; # end nvidia - }; # end hardware + }; + }; + services = { xserver.videoDrivers = [ "nvidia" ]; openssh.enable = true; - }; # end services + }; + environment = { variables = { GBM_BACKEND = "nvidia-drm"; __GLX_VENDOR_LIBRARY_NAME = "nvidia"; - MOZ_DISABLE_RDD_SANDBOX= "1" ; + MOZ_DISABLE_RDD_SANDBOX = "1"; LIBVA_DRIVER_NAME = "nvidia"; }; systemPackages = [ @@ -66,6 +66,7 @@ pkgs.gamescope ]; }; + programs = { gamemode.enable = true; steam = { @@ -73,10 +74,8 @@ remotePlay.openFirewall = true; extraCompatPackages = [ pkgs.proton-ge-bin ]; package = pkgs.steam.override { - extraPkgs = (pkgs: [ - pkgs.gamemode - ]); + extraPkgs = _pkgs: [ pkgs.gamemode ]; }; }; }; -} # end file +} diff --git a/hosts/tower/hardware-configuration.nix b/nixos/hosts/tower/hardware-configuration.nix similarity index 100% rename from hosts/tower/hardware-configuration.nix rename to nixos/hosts/tower/hardware-configuration.nix diff --git a/hosts/common/default.nix b/nixos/modules/base.nix similarity index 67% rename from hosts/common/default.nix rename to nixos/modules/base.nix index 0ffd027..f981cff 100644 --- a/hosts/common/default.nix +++ b/nixos/modules/base.nix @@ -1,59 +1,62 @@ -{ config, pkgs, pkgs-unstable, lib, ... }: { +{ config, pkgs, lib, repoLocalPath, ... }: +{ boot = { kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; kernel.sysctl = { "net.ipv4.ip_unprivileged_port_start" = 0; }; - initrd = { - network ={ + initrd = { + network = { ssh.shell = pkgs.bash; }; }; }; + security.sudo-rs.enable = true; system.stateVersion = "24.05"; + system.autoUpgrade = { enable = true; persistent = true; - flake = "/home/alisceon/.nixos_config"; + flake = repoLocalPath; flags = [ "--print-build-logs" "--no-write-lock-file" ]; dates = "daily"; - }; # end system.autoUpgrade + }; nix = { settings = { experimental-features = [ "nix-command" "flakes" ]; auto-optimise-store = true; trusted-users = [ "root" "alisceon" ]; - }; # end settings + }; gc = { automatic = true; persistent = true; dates = "daily"; options = "--delete-older-than 7d"; - }; # end gc + }; registry = { templates.to = { type = "git"; url = "git+ssh://git@git.malice.zone/alisceon/devenv_templates.git"; - }; # end templates.to + }; nixpkgs.to = { type = "github"; owner = "NixOS"; repo = "nixpkgs"; ref = "nixos-unstable"; - }; # end nixpkgs.to + }; nixpkgs-stable.to = { type = "github"; owner = "NixOS"; repo = "nixpkgs"; ref = "nixos-25.05"; - }; # end nixpkgs.to - }; #end registry - }; #end nix + }; + }; + }; console.keyMap = "sv-latin1"; networking.networkmanager.enable = true; @@ -73,93 +76,79 @@ environment = { systemPackages = with pkgs; [ - # Libraries libressl - - # CLI tools git wget curl - btop # system monitor - ripgrep # grep replacement - fd # find replacement - nh # nix helper - jq # JSON processor + btop + ripgrep + fd + nh + jq ncdu pciutils usbutils tree - fzf # fuzzy finder + fzf psmisc pv file nix-tree unzip - lsd - - # Shells + lsd bash nushell fish powershell - - # Languages python3 python3Packages.python-lsp-server + podman + ]; - # Virtualization - podman - ]; # end systemPackages - - shells = with pkgs; [ + shells = with pkgs; [ bash nushell fish powershell xonsh ]; + etc."current-system-packages".text = - let - packages = builtins.map (p: "${p.name}:\t${p}") config.environment.systemPackages; - sortedUnique = builtins.sort builtins.lessThan (pkgs.lib.lists.unique packages); - formatted = pkgs.lib.strings.concatLines sortedUnique; - in - formatted; - }; # end environment + let + packages = builtins.map (p: "${p.name}:\t${p}") config.environment.systemPackages; + sortedUnique = builtins.sort builtins.lessThan (pkgs.lib.lists.unique packages); + in + pkgs.lib.strings.concatLines sortedUnique; + }; virtualisation = { - #spiceUSBRedirection.enable = true; libvirtd = { enable = true; - qemu = { - swtpm.enable = true; - }; + qemu.swtpm.enable = true; }; containers.enable = true; - docker = { - enable = true; - }; + docker.enable = true; podman = { enable = true; dockerCompat = false; defaultNetwork.settings.dns_enabled = true; - }; # end podman + }; oci-containers.backend = "podman"; - }; # end virtualisation + }; users = { defaultUserShell = pkgs.bash; - groups.docker = {}; + groups.docker = { }; users.alisceon = { isNormalUser = true; - extraGroups = [ "wheel" "networkmanager" "podman" "docker" "libvirtd"]; + extraGroups = [ "wheel" "networkmanager" "podman" "docker" "libvirtd" ]; shell = pkgs.xonsh; openssh.authorizedKeys.keys = [ "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPN1Cd2UlHo03Jqgi5Yb4io/3gh/X4wCb8LcmKlpAovQa271CKDBtYOUKn+Fts03g6dBMfaWMty6VGPMGDMONmc= alisceon@electra" "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCvRYyYjN8z0yoPrHtaTQXY0iEtPl79K6/uXVceuS+31JGjRnqJjuDYg6KxAykGSfhercNdAJ2BTYJRGpMsW0Xn7+iq07TItcjJjERm7rjQZko4vauS62NdnV6BEG+6ktasb9CcepzwoRkLEXQOad3XbLbo0V2sj6uI5Rgq2Cfh6f9x1E1DJ87o6Ngkm+vQzdv4NYeya/O4vuoAw6BNhp4vyr9k+0K+TRLjflYPUwtb8U/agoYI5RoLZMa6eBKdPbLVYyahpMlYjHwr90H4c9veHliILcDSA8h6upcXSDwZiCPyu6cI4zRbzGQVg84iLmIs5ocMWsnuDQbqn5iM3BTV37atnTPI3O2C9WBxuOaGpk4C338V0CAfTo6GG/OSaFzfLBFE29nY6uXcCPH7KiDpig0naVWlpHZhED5OQRoSXBeyu4BgadV6eZ43HOcdbOAqbLcB1nvkKPi52Vj+JqwS8zIjQpipX22Trx2u4ike99ijeK6/XeoTnEAcUS0fcYQ0FDqqfLmr/HuxkEQ2NZF0sFFqVGUlpVJMFblNOH4L8A2kApnsrmlxnlVE+r0tTnnnK5tfCpyou/LPDM+4TzGw2nV2cwsZKbGaHvMM/qIvVva90mTcYfuDvGB10eQ2P9tN1TIjseONVLDVKNjNGzDBFY4RMeMJOWWQy0aBh0FP5Q== user@hannah.afk" ]; - }; - }; # end users + }; + }; programs = { command-not-found.enable = true; @@ -173,30 +162,30 @@ pkgs.nur.repos.xonsh-xontribs.xontrib-abbrevs pkgs.nur.repos.xonsh-xontribs.xontrib-clp pkgs.nur.repos.xonsh-xontribs.xontrib-bashisms - ( - ps.buildPythonPackage - rec { - name = "xontrib-fzf-completions"; - version = "v0.0.2"; - format = "pyproject"; + ( + ps.buildPythonPackage + rec { + name = "xontrib-fzf-completions"; + version = "v0.0.2"; + format = "pyproject"; nativeBuildInputs = [ ps.setuptools ps.setuptools-scm ps.wheel ]; - propagatedBuildInputs = [ ps.xonsh ]; - src = pkgs.fetchFromGitHub { - owner = "doronz88"; - repo = "${name}"; - rev = "${version}"; - sha256 = "sha256-1z5xHX4Psevn8686QkwIzv/LOJ5IMJc2nQ5Hg/2svTc="; - }; - meta = { - homepage = "https://github.com/doronz88/xontrib-fzf-completions"; - description = "fuzzy completions for xonsh"; - license = pkgs.lib.licenses.mit; - maintainers = [ ]; - }; # end meta - } # end buildPythonPackage - ) - ]; # end extraPackages - config = (builtins.readFile ../../home/conf/xonsh/xonshrc); - }; # end xonsh - }; # end programs -} #end file + propagatedBuildInputs = [ ps.xonsh ]; + src = pkgs.fetchFromGitHub { + owner = "doronz88"; + repo = "${name}"; + rev = "${version}"; + sha256 = "sha256-1z5xHX4Psevn8686QkwIzv/LOJ5IMJc2nQ5Hg/2svTc="; + }; + meta = { + homepage = "https://github.com/doronz88/xontrib-fzf-completions"; + description = "fuzzy completions for xonsh"; + license = pkgs.lib.licenses.mit; + maintainers = [ ]; + }; + } + ) + ]; + config = builtins.readFile ../../home/conf/xonsh/xonshrc; + }; + }; +} diff --git a/nixos/modules/profiles/server.nix b/nixos/modules/profiles/server.nix new file mode 100644 index 0000000..8c21bf9 --- /dev/null +++ b/nixos/modules/profiles/server.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: +{ + system.autoUpgrade.allowReboot = true; + + services.openssh = { + enable = true; + permitRootLogin = "no"; + }; + + environment.systemPackages = with pkgs; [ + devenv + direnv + ]; +} diff --git a/hosts/common/workstation.nix b/nixos/modules/profiles/workstation.nix similarity index 76% rename from hosts/common/workstation.nix rename to nixos/modules/profiles/workstation.nix index 7207360..48c00b2 100644 --- a/hosts/common/workstation.nix +++ b/nixos/modules/profiles/workstation.nix @@ -1,5 +1,4 @@ -{ config, pkgs, pkgs-unstable, ... }: - +{ pkgs, pkgs-unstable, ... }: { boot = { plymouth.enable = true; @@ -9,6 +8,7 @@ "systemd.show_status=auto" ]; }; + security.sudo.wheelNeedsPassword = false; services = { @@ -25,7 +25,6 @@ gnome-keyring.enable = true; gnome-initial-setup.enable = false; }; - # For keychron udev.packages = [ pkgs.via pkgs.qmk @@ -34,11 +33,9 @@ ]; fwupd.enable = true; openssh.settings.PasswordAuthentication = false; - }; # end services + }; - programs = { - dconf.enable = true; - }; # end programs + programs.dconf.enable = true; networking.firewall.allowedTCPPorts = [ 1312 @@ -46,25 +43,18 @@ 8080 8888 ]; - + environment = { systemPackages = [ - # Chat pkgs.discord pkgs.signal-desktop pkgs.mumble - - # Browser (pkgs.chromium.override { enableWideVine = true; }) pkgs.google-chrome - - # Development pkgs.vscodium pkgs.codex pkgs.devenv pkgs.direnv - - # Other pkgs.syncthing pkgs.steam pkgs.krita @@ -75,8 +65,8 @@ pkgs.via pkgs.plymouth pkgs.xorg.xhost - (pkgs.bottles.override { removeWarningPopup = true;}) - ]; # end systemPackages - sessionVariables.NIXOS_OZONE_WL = "1"; - }; # end environment -} #end file + (pkgs.bottles.override { removeWarningPopup = true; }) + ]; + sessionVariables.NIXOS_OZONE_WL = "1"; + }; +} diff --git a/hosts/common/stylix.nix b/nixos/modules/theme/stylix.nix similarity index 88% rename from hosts/common/stylix.nix rename to nixos/modules/theme/stylix.nix index 714376b..198753f 100644 --- a/hosts/common/stylix.nix +++ b/nixos/modules/theme/stylix.nix @@ -1,10 +1,10 @@ -{ config, pkgs, lib, ... }: +{ pkgs, ... }: { -stylix = { + stylix = { enable = true; autoEnable = true; enableReleaseChecks = false; - base16Scheme = { # based on https://github.com/tinted-theming/schemes/blob/spec-0.11/base16/selenized-black.yaml + base16Scheme = { base00 = "#181818"; base01 = "#252525"; base02 = "#3b3b3b"; @@ -21,7 +21,7 @@ stylix = { base0D = "#a580e2"; base0E = "#368aeb"; base0F = "#eb6eb7"; - }; + }; polarity = "dark"; fonts = { @@ -48,16 +48,18 @@ stylix = { popups = 14; }; }; + cursor = { package = pkgs.whitesur-cursors; name = "WhiteSur-cursors"; size = 20; }; + icons = { enable = true; package = pkgs.whitesur-icon-theme; light = "WhiteSur-light"; dark = "WhiteSur-dark"; }; - }; # end stylix + }; } diff --git a/hosts/common/wm/gnome.nix b/nixos/modules/wm/gnome.nix similarity index 75% rename from hosts/common/wm/gnome.nix rename to nixos/modules/wm/gnome.nix index 10c59f7..9b4d7b2 100644 --- a/hosts/common/wm/gnome.nix +++ b/nixos/modules/wm/gnome.nix @@ -1,10 +1,8 @@ -{ config, pkgs, ... }: - +{ pkgs, ... }: { security.sudo.wheelNeedsPassword = false; services = { - # Remove xserver. when the patch comes xserver.displayManager = { gdm.enable = true; gdm.wayland = true; @@ -14,7 +12,7 @@ gnome-keyring.enable = true; gnome-initial-setup.enable = false; }; - }; # end services + }; environment = { gnome.excludePackages = with pkgs; [ @@ -29,13 +27,12 @@ gnome-calendar gnome-initial-setup gnome-clocks - ]; # end gnome.excludePackages + ]; systemPackages = [ - # GNOME tweaks and extensions pkgs.gnome-tweaks pkgs.dconf-editor pkgs.gnomeExtensions.ddterm - ]; # end systemPackages - }; # end environment -} #end file + ]; + }; +} diff --git a/nixos/modules/wm/sway.nix b/nixos/modules/wm/sway.nix new file mode 100644 index 0000000..227567b --- /dev/null +++ b/nixos/modules/wm/sway.nix @@ -0,0 +1,99 @@ +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + pavucontrol + libinput + libinput-gestures + libnotify + wmctrl + playerctl + xdg-utils + shared-mime-info + libsecret + gnome-text-editor + loupe + evince + seahorse + nautilus + ]; + + programs = { + sway = { + enable = true; + wrapperFeatures.base = true; + wrapperFeatures.gtk = true; + extraOptions = [ "--unsupported-gpu" ]; + extraPackages = with pkgs; [ + swayidle + swaylock + swaybg + grim + slurp + wl-clipboard + pulseaudio + sway-contrib.grimshot + foot + kitty + dotool + mako + espanso-wayland + ]; + }; + + uwsm = { + enable = true; + waylandCompositors = { + sway = { + prettyName = "Sway"; + comment = "Sway compositor managed by UWSM"; + binPath = "${pkgs.sway}/bin/sway"; + extraArgs = [ "--unsupported-gpu" ]; + }; + }; + }; + + light.enable = true; + dconf.enable = true; + seahorse.enable = true; + }; + + security = { + polkit.enable = true; + pam.services = { + greetd.enableGnomeKeyring = true; + login.enableGnomeKeyring = true; + swaylock.text = '' + auth sufficient pam_unix.so try_first_pass likeauth nullok + auth sufficient pam_fprintd.so + auth include login + ''; + }; + }; + + services = { + greetd = { + enable = true; + settings = { + initial_session = { + command = "uwsm start -- sway-uwsm.desktop"; + user = "alisceon"; + }; + default_session = { + command = "${pkgs.tuigreet}/bin/tuigreet --time --cmd 'uwsm start -- sway-uwsm.desktop' --remember --asterisks''"; + user = "greeter"; + }; + }; + }; + + logind.settings.Login = { + HandleLidSwitch = "suspend"; + HandleLidSwitchExternalPower = "suspend"; + }; + + dbus.packages = [ pkgs.seahorse pkgs.gnome-keyring pkgs.gcr ]; + gnome.gcr-ssh-agent.enable = true; + gvfs.enable = true; + }; + + users.users.alisceon.extraGroups = [ "video" "input" ]; +}