diff --git a/flake.lock b/flake.lock index bfcd3b85..5fac55b8 100644 --- a/flake.lock +++ b/flake.lock @@ -357,6 +357,21 @@ "url": "https://codeberg.org/Scrumplex/honeylinks.git" } }, + "import-tree": { + "locked": { + "lastModified": 1752730890, + "narHash": "sha256-GES8fapSLGz36MMPRVNkSUWXUTtqvGQNXHjRmRLfJUY=", + "owner": "vic", + "repo": "import-tree", + "rev": "6ebb8cb87987b20264c09296166543fd3761d274", + "type": "github" + }, + "original": { + "owner": "vic", + "repo": "import-tree", + "type": "github" + } + }, "inhibridge": { "inputs": { "flake-parts": [ @@ -799,6 +814,7 @@ "git-hooks": "git-hooks", "home-manager": "home-manager", "honeylinks-website": "honeylinks-website", + "import-tree": "import-tree", "inhibridge": "inhibridge", "jovian": "jovian", "lanzaboote": "lanzaboote", diff --git a/flake.nix b/flake.nix index 2025bb45..33680a03 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,7 @@ url = "github:hercules-ci/flake-parts"; inputs.nixpkgs-lib.follows = "nixpkgs"; }; + import-tree.url = "github:vic/import-tree"; nixos-hardware.url = "github:NixOS/nixos-hardware"; srvos = { url = "github:nix-community/srvos"; @@ -155,6 +156,8 @@ ./parts/checks.nix ./parts/dev.nix ./parts/nixpkgs-dev.nix + + (inputs.import-tree ./nix) ]; systems = [ diff --git a/lib/default.nix b/lib/default.nix index d92f2456..5ecc6894 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,4 +1,8 @@ -{inputs, ...}: { +{ + config, + inputs, + ... +}: { _module.args.lib' = { mkHost = { hostName, @@ -14,6 +18,7 @@ specialArgs = { inherit inputs; + fpConfig = config; }; }; }; diff --git a/nix/modules/0_base/man.nix b/nix/modules/0_base/man.nix new file mode 100644 index 00000000..4736a5b6 --- /dev/null +++ b/nix/modules/0_base/man.nix @@ -0,0 +1,10 @@ +{ + flake.modules.nixos.base = {pkgs, ...}: { + documentation.man = { + enable = true; + man-db.enable = true; + }; + + environment.systemPackages = [pkgs.man-pages]; + }; +} diff --git a/nix/modules/0_base/nix.nix b/nix/modules/0_base/nix.nix new file mode 100644 index 00000000..d19d2363 --- /dev/null +++ b/nix/modules/0_base/nix.nix @@ -0,0 +1,41 @@ +{inputs, ...}: let + channelPath = "/etc/nix/channels/nixpkgs"; +in { + flake.modules.nixos.base = {...}: { + imports = [ + inputs.nix-index-database.nixosModules.nix-index + ]; + + programs.command-not-found.enable = false; + programs.nix-index-database.comma.enable = true; + + nix = { + daemonCPUSchedPolicy = "idle"; + daemonIOSchedClass = "idle"; + daemonIOSchedPriority = 6; + settings = { + auto-optimise-store = true; + experimental-features = ["nix-command" "flakes" "no-url-literals"]; + substituters = [ + "https://cache.nixos.org" + ]; + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + ]; + trusted-users = ["root"]; + }; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 14d"; + persistent = true; + }; + nixPath = [ + "nixpkgs=${channelPath}" + ]; + registry.n.flake = inputs.nixpkgs; + }; + + systemd.tmpfiles.settings."10-nixpkgs".${channelPath}."L+".argument = inputs.nixpkgs.outPath; + }; +} diff --git a/nix/modules/0_base/sshd.nix b/nix/modules/0_base/sshd.nix new file mode 100644 index 00000000..fa3d809c --- /dev/null +++ b/nix/modules/0_base/sshd.nix @@ -0,0 +1,13 @@ +{ + flake.modules.nixos.base = { + services.openssh = { + enable = true; + settings.PasswordAuthentication = false; + }; + + users.users.root.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJV9lYhi0kcwAAjPTMl6sycwCGkjrI0bvTIwpPuXkW2W scrumplex@andromeda" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG4jTPHOnfxvBOcVmExcU+j2u9Lsf1OoVG/ols2Met9/ scrumplex@dyson" + ]; + }; +} diff --git a/nix/modules/0_base/sudo.nix b/nix/modules/0_base/sudo.nix new file mode 100644 index 00000000..8664d941 --- /dev/null +++ b/nix/modules/0_base/sudo.nix @@ -0,0 +1,31 @@ +{ + flake.modules.nixos.base = { + security.sudo = { + extraRules = [ + { + groups = ["wheel"]; + commands = [ + { + command = "/run/current-system/sw/bin/nixos-rebuild"; + options = ["NOPASSWD"]; + } + { + command = "/run/current-system/sw/bin/networkctl"; + options = ["NOPASSWD"]; + } + { + command = "/run/current-system/sw/bin/systemctl"; + options = ["NOPASSWD"]; + } + ]; + } + ]; + extraConfig = '' + Defaults lecture = always + Defaults lecture_file = ${./sudo_lecture.txt} + Defaults pwfeedback + Defaults passwd_timeout=0 + ''; + }; + }; +} diff --git a/misc/lecture.txt b/nix/modules/0_base/sudo_lecture.txt similarity index 100% rename from misc/lecture.txt rename to nix/modules/0_base/sudo_lecture.txt diff --git a/nix/modules/0_base/tools.nix b/nix/modules/0_base/tools.nix new file mode 100644 index 00000000..65fbf4a0 --- /dev/null +++ b/nix/modules/0_base/tools.nix @@ -0,0 +1,42 @@ +{ + flake.modules.nixos.base = {pkgs, ...}: { + programs.mtr.enable = true; + programs.bandwhich.enable = true; + + programs.bat.enable = true; + + environment.systemPackages = with pkgs; [ + htop + + jq + + just + + dig + lsof + nload + tree + + pciutils + psmisc + usbutils + + p7zip + unzip + zip + + vimv-rs + ]; + + environment.etc."htoprc".text = '' + .tree_view_always_by_pid=1 + delay=10 + fields=0 48 17 18 38 39 40 2 46 47 49 1 + left_meter_modes=1 1 1 + left_meters=LeftCPUs2 Memory Swap + right_meter_modes=1 2 2 2 + right_meters=RightCPUs2 Tasks LoadAverage Uptime + tree_view=1 + ''; + }; +} diff --git a/nix/modules/1_desktop/keyboard.nix b/nix/modules/1_desktop/keyboard.nix new file mode 100644 index 00000000..3b94e9a9 --- /dev/null +++ b/nix/modules/1_desktop/keyboard.nix @@ -0,0 +1,5 @@ +{ + flake.modules.nixos.desktop = {pkgs, ...}: { + services.udev.packages = with pkgs; [meletrix-udev-rules]; + }; +} diff --git a/nix/modules/1_desktop/module.nix b/nix/modules/1_desktop/module.nix new file mode 100644 index 00000000..9aaf207c --- /dev/null +++ b/nix/modules/1_desktop/module.nix @@ -0,0 +1,7 @@ +{config, ...}: { + flake.modules.nixos.desktop = { + imports = [config.flake.modules.nixos.base]; + + home-manager.sharedModules = [config.flake.modules.homeManager.desktop]; + }; +} diff --git a/nixosConfigurations/common/desktop/pipewire/compressor.conf b/nix/modules/1_desktop/pipewire/compressor.conf similarity index 100% rename from nixosConfigurations/common/desktop/pipewire/compressor.conf rename to nix/modules/1_desktop/pipewire/compressor.conf diff --git a/nix/modules/1_desktop/pipewire/compressor.nix b/nix/modules/1_desktop/pipewire/compressor.nix new file mode 100644 index 00000000..6e7c5626 --- /dev/null +++ b/nix/modules/1_desktop/pipewire/compressor.nix @@ -0,0 +1,8 @@ +{ + flake.modules.homeManager.desktop = {pkgs, ...}: { + services.pipewire.instances.compressor = { + config = ./compressor.conf; + extraPackages = [pkgs.calf]; + }; + }; +} diff --git a/nixosConfigurations/common/desktop/pipewire/desktop-source.conf b/nix/modules/1_desktop/pipewire/desktop-source.conf similarity index 100% rename from nixosConfigurations/common/desktop/pipewire/desktop-source.conf rename to nix/modules/1_desktop/pipewire/desktop-source.conf diff --git a/nix/modules/1_desktop/pipewire/desktop-source.nix b/nix/modules/1_desktop/pipewire/desktop-source.nix new file mode 100644 index 00000000..5fb27bfa --- /dev/null +++ b/nix/modules/1_desktop/pipewire/desktop-source.nix @@ -0,0 +1,7 @@ +{ + flake.modules.homeManager.desktop = { + services.pipewire.instances.desktop-source = { + config = ./desktop-source.conf; + }; + }; +} diff --git a/nix/modules/1_desktop/pipewire/rtkit.nix b/nix/modules/1_desktop/pipewire/rtkit.nix new file mode 100644 index 00000000..d0ce0f72 --- /dev/null +++ b/nix/modules/1_desktop/pipewire/rtkit.nix @@ -0,0 +1,6 @@ +{config, ...}: { + flake.modules.nixos.desktop = { + security.rtkit.enable = true; + users.users.${config.flake.meta.username}.extraGroups = ["rtkit"]; + }; +} diff --git a/nixosConfigurations/common/desktop/pipewire/default.nix b/nix/modules/1_desktop/pipewire/schiit.nix similarity index 50% rename from nixosConfigurations/common/desktop/pipewire/default.nix rename to nix/modules/1_desktop/pipewire/schiit.nix index e118a408..0a4c4c6f 100644 --- a/nixosConfigurations/common/desktop/pipewire/default.nix +++ b/nix/modules/1_desktop/pipewire/schiit.nix @@ -1,15 +1,6 @@ -{pkgs, ...}: { - security.rtkit.enable = true; - primaryUser.extraGroups = ["rtkit"]; - - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - - wireplumber.configPackages = [ +{ + flake.modules.nixos.desktop = {pkgs, ...}: { + services.pipewire.wireplumber.configPackages = [ (pkgs.writeTextFile { name = "schiit-wireplumber-rules"; text = '' @@ -31,19 +22,4 @@ }) ]; }; - - hm.services.pipewire = { - enable = true; - instances = { - compressor = { - config = ./compressor.conf; - extraPackages = [pkgs.calf]; - }; - desktop-source = {config = ./desktop-source.conf;}; - #equalizer = { - # config = ./equalizer.conf; - # extraPackages = [ pkgs.lsp-plugins ]; - #}; - }; - }; } diff --git a/nix/modules/1_desktop/pipewire/service.nix b/nix/modules/1_desktop/pipewire/service.nix new file mode 100644 index 00000000..0f0e3b83 --- /dev/null +++ b/nix/modules/1_desktop/pipewire/service.nix @@ -0,0 +1,16 @@ +{inputs, ...}: { + flake.modules.nixos.desktop = { + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; + }; + + flake.modules.homeManager.desktop = { + imports = [inputs.scrumpkgs.hmModules.pipewire]; + services.pipewire.enable = true; + }; +} diff --git a/nix/modules/1_desktop/user.nix b/nix/modules/1_desktop/user.nix new file mode 100644 index 00000000..396fb76f --- /dev/null +++ b/nix/modules/1_desktop/user.nix @@ -0,0 +1,42 @@ +{ + config, + inputs, + ... +}: { + flake.modules.nixos.desktop = { + imports = [ + inputs.home-manager.nixosModules.home-manager + ]; + + users.users.${config.flake.meta.username} = { + isNormalUser = true; + hashedPassword = "$y$j9T$JbosTEvX3uH6.mFV/Sz071$6vVkITFq4INQFdf51.guqaD68JWp6ZcVNGVfPqqIzL/"; + + extraGroups = [ + "wheel" + "audio" + "video" + "input" + "dialout" + ]; + }; + + nix.settings.trusted-users = [config.flake.meta.username]; + + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + + users.${config.flake.meta.username} = {osConfig, ...}: { + home = { + username = config.flake.meta.username; + homeDirectory = osConfig.users.users.${config.flake.meta.username}.home; + }; + }; + }; + }; + + flake.modules.homeManager.desktop = {osConfig, ...}: { + home.stateVersion = osConfig.system.stateVersion; + }; +} diff --git a/nix/modules/2_laptop/module.nix b/nix/modules/2_laptop/module.nix new file mode 100644 index 00000000..a8c9dc70 --- /dev/null +++ b/nix/modules/2_laptop/module.nix @@ -0,0 +1,7 @@ +{config, ...}: { + flake.modules.nixos.laptop = { + imports = [config.flake.modules.nixos.desktop]; + + home-manager.sharedModules = [config.flake.modules.homeManager.laptop]; + }; +} diff --git a/nix/modules/2_laptop/networkmanager.nix b/nix/modules/2_laptop/networkmanager.nix new file mode 100644 index 00000000..08bd5caa --- /dev/null +++ b/nix/modules/2_laptop/networkmanager.nix @@ -0,0 +1,12 @@ +{ + flake.modules.nixos.laptop = { + networking.networkmanager.enable = true; + + services.avahi.enable = true; + }; + + flake.modules.homeManager.laptop = { + xsession.preferStatusNotifierItems = true; # needed for network-manager-applet + services.network-manager-applet.enable = true; + }; +} diff --git a/nix/modules/base.nix b/nix/modules/base.nix new file mode 100644 index 00000000..8b515f36 --- /dev/null +++ b/nix/modules/base.nix @@ -0,0 +1,5 @@ +{inputs, ...}: { + imports = [ + inputs.flake-parts.flakeModules.modules + ]; +} diff --git a/nix/modules/meta.nix b/nix/modules/meta.nix new file mode 100644 index 00000000..8adb2dac --- /dev/null +++ b/nix/modules/meta.nix @@ -0,0 +1,7 @@ +{lib, ...}: { + options.flake.meta = { + username = lib.mkOption { + default = "scrumplex"; + }; + }; +} diff --git a/nixosConfigurations/common/bat.nix b/nixosConfigurations/common/bat.nix deleted file mode 100644 index 136769be..00000000 --- a/nixosConfigurations/common/bat.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - hm = { - catppuccin.bat.enable = true; - programs.bat.enable = true; - }; -} diff --git a/nixosConfigurations/common/desktop/pipewire/equalizer.conf b/nixosConfigurations/common/desktop/pipewire/equalizer.conf deleted file mode 100644 index 0bef6f6c..00000000 --- a/nixosConfigurations/common/desktop/pipewire/equalizer.conf +++ /dev/null @@ -1,86 +0,0 @@ -context.spa-libs = { - audio.convert.* = audioconvert/libspa-audioconvert - support.* = support/libspa-support -} - -context.modules = [ - { name = libpipewire-module-rtkit - args = { - nice.level = -11 - rt.prio = 88 - rt.time.soft = 200000 - rt.time.hard = 200000 - } - flags = [ ifexists nofail ] - } - { name = libpipewire-module-protocol-native } - { name = libpipewire-module-client-node } - { name = libpipewire-module-adapter } - - { name = libpipewire-module-filter-chain - args = { - node.name = "equalizer" - node.description = "Equalized Output" - media.name = "Equalized Output" - filter.graph = { - nodes = [ - { - type = lv2 - name = "Parametric Equalizer" - plugin = "http://lsp-plug.in/plugins/lv2/para_equalizer_x16_stereo" - # This is tuned to match Harman AE OE 2018 target for Sennheiser HD 6XX - # Shout out to crinacle's (In-Ear Fidelity) headphone graph comparison tool for the AutoEQ - # Gain values (g_X) are calculated as follows: `expf(0.05 * value * M_LN10)`, or `e^(0.05 * value * ln(10))` - control = { - "ft_0" 1 - "ft_1" 1 - "ft_2" 1 - "ft_3" 1 - "ft_4" 1 - "ft_5" 1 - "ft_6" 1 - "ft_7" 1 - "ft_8" 1 - "f_0" 20.0 - "g_0" 2.398832919 # 7.6 dB - "q_0" 0.5 - "f_1" 180.0 - "g_1" 0.7585775750 # -2.4 dB - "q_1" 1.0 - "f_2" 670.0 - "g_2" 1.083926914 # 0.7 dB - "q_2" 1.2 - "f_3" 1300.0 - "g_3" 0.8413951416 # -1.5 dB - "q_3" 1.5 - "f_4" 2000.0 - "g_4" 1.412537545 # 3.0 dB - "q_4" 2.0 - "f_5" 3100.0 - "g_5" 0.6918309709 # -3.2 dB - "q_5" 2.0 - "f_6" 4000.0 - "g_6" 1.188502227 # 1.5 dB - "q_6" 2.0 - "f_7" 5600.0 - "g_7" 0.6839116473 # -3.3 dB - "q_7" 2.0 - "f_8" 7900.0 - "g_8" 2.162718524 # 6.7 dB - "q_8" 1.3 - } - } - ] - } - capture.props = { - node.passive = true - media.class = Audio/Sink - node.pause-on-idle = false - } - playback.props = { - node.pause-on-idle = false - } - } - } -] - diff --git a/nixosConfigurations/common/home.nix b/nixosConfigurations/common/home.nix index 9639ac87..2d0539c8 100644 --- a/nixosConfigurations/common/home.nix +++ b/nixosConfigurations/common/home.nix @@ -4,56 +4,22 @@ lib, ... }: let - inherit (builtins) attrValues; inherit (lib.lists) optional; - inherit (lib.modules) mkAliasOptionModule; - - inherit (inputs) catppuccin home-manager scrumpkgs; - - username = "scrumplex"; in { imports = [ - (mkAliasOptionModule ["hm"] ["home-manager" "users" username]) - (mkAliasOptionModule ["primaryUser"] ["users" "users" username]) - - home-manager.nixosModules.home-manager + (lib.mkAliasOptionModule ["hm"] ["home-manager" "users" "scrumplex"]) + (lib.mkAliasOptionModule ["primaryUser"] ["users" "users" "scrumplex"]) ]; - config = { - primaryUser = { - isNormalUser = true; - hashedPassword = "$y$j9T$JbosTEvX3uH6.mFV/Sz071$6vVkITFq4INQFdf51.guqaD68JWp6ZcVNGVfPqqIzL/"; - # TODO: roles! - extraGroups = - ["wheel" "audio" "video" "input" "dialout"] - ++ optional config.networking.networkmanager.enable "networkmanager" - ++ optional config.programs.adb.enable "adbusers" - ++ optional config.virtualisation.libvirtd.enable "libvirtd" - ++ optional config.virtualisation.podman.enable "podman"; - }; - nix.settings.trusted-users = [username]; - - hm = { - home.homeDirectory = config.users.users."${username}".home; - home.username = username; - - programs.home-manager.enable = true; - systemd.user.startServices = "sd-switch"; - - home.stateVersion = config.system.stateVersion; - }; + home-manager.sharedModules = [ + inputs.catppuccin.homeModules.catppuccin + inputs.scrumpkgs.hmModules.waybar-camera-blank + inputs.scrumpkgs.hmModules.waybar-pa-mute + ]; - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - sharedModules = - attrValues scrumpkgs.hmModules - ++ [ - catppuccin.homeModules.catppuccin - ]; - extraSpecialArgs = { - inherit inputs; - }; - }; - }; + primaryUser.extraGroups = + optional config.networking.networkmanager.enable "networkmanager" + ++ optional config.programs.adb.enable "adbusers" + ++ optional config.virtualisation.libvirtd.enable "libvirtd" + ++ optional config.virtualisation.podman.enable "podman"; } diff --git a/nixosConfigurations/common/htop.nix b/nixosConfigurations/common/htop.nix deleted file mode 100644 index 0e17965f..00000000 --- a/nixosConfigurations/common/htop.nix +++ /dev/null @@ -1,24 +0,0 @@ -{config, ...}: { - hm.programs.htop = { - enable = true; - settings = - { - "delay" = 10; - ".tree_view_always_by_pid" = 1; - "tree_view" = 1; - } - // (with config.hm.lib.htop; - leftMeters [ - (bar "LeftCPUs2") - (bar "Memory") - (bar "Swap") - ]) - // (with config.hm.lib.htop; - rightMeters [ - (bar "RightCPUs2") - (text "Tasks") - (text "LoadAverage") - (text "Uptime") - ]); - }; -} diff --git a/nixosConfigurations/common/misc.nix b/nixosConfigurations/common/misc.nix index 605c6346..13a66aa1 100644 --- a/nixosConfigurations/common/misc.nix +++ b/nixosConfigurations/common/misc.nix @@ -10,19 +10,6 @@ system.rebuild.enableNg = true; - services.openssh.enable = true; - - security.sudo = { - extraConfig = '' - Defaults lecture = always - Defaults lecture_file = ${../../misc/lecture.txt} - Defaults pwfeedback - Defaults passwd_timeout=0 - ''; - }; - - environment.systemPackages = with pkgs; [just]; - programs.adb.enable = true; networking.firewall = { @@ -38,23 +25,5 @@ ]; }; - services.udev.packages = with pkgs; [meletrix-udev-rules]; - services.udisks2.enable = true; - - security.sudo.extraRules = [ - { - groups = ["wheel"]; - commands = [ - { - command = "/run/current-system/sw/bin/nixos-rebuild"; - options = ["NOPASSWD"]; - } - { - command = "/run/current-system/sw/bin/systemctl"; - options = ["NOPASSWD"]; - } - ]; - } - ]; } diff --git a/nixosConfigurations/common/nix-index.nix b/nixosConfigurations/common/nix-index.nix deleted file mode 100644 index cc05ac1f..00000000 --- a/nixosConfigurations/common/nix-index.nix +++ /dev/null @@ -1,8 +0,0 @@ -{inputs, ...}: { - imports = [ - inputs.nix-index-database.nixosModules.nix-index - ]; - - programs.command-not-found.enable = false; - programs.nix-index-database.comma.enable = true; -} diff --git a/nixosConfigurations/common/nix.nix b/nixosConfigurations/common/nix.nix deleted file mode 100644 index af3968d8..00000000 --- a/nixosConfigurations/common/nix.nix +++ /dev/null @@ -1,38 +0,0 @@ -{inputs, ...}: let - channelPath = "/etc/nix/channels/nixpkgs"; -in { - nix = { - daemonCPUSchedPolicy = "idle"; - daemonIOSchedClass = "idle"; - daemonIOSchedPriority = 6; - settings = { - auto-optimise-store = true; - experimental-features = ["nix-command" "flakes" "no-url-literals"]; - substituters = [ - "https://cache.nixos.org" - "https://nix-community.cachix.org" - "https://nixpkgs-wayland.cachix.org" - "https://prismlauncher.cachix.org" - ]; - trusted-public-keys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" - "prismlauncher.cachix.org-1:9/n/FGyABA2jLUVfY+DEp4hKds/rwO+SCOtbOkDzd+c=" - ]; - trusted-users = ["root"]; - }; - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 30d"; - persistent = true; - }; - nixPath = [ - "nixpkgs=${channelPath}" - ]; - registry.n.flake = inputs.nixpkgs; - }; - - systemd.tmpfiles.settings."10-nixpkgs".${channelPath}."L+".argument = inputs.nixpkgs.outPath; -} diff --git a/nixosConfigurations/common/openssh.nix b/nixosConfigurations/common/openssh.nix deleted file mode 100644 index c4b9777a..00000000 --- a/nixosConfigurations/common/openssh.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ - services.openssh = { - enable = true; - settings.PasswordAuthentication = false; - }; - - users.users.root.openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJV9lYhi0kcwAAjPTMl6sycwCGkjrI0bvTIwpPuXkW2W scrumplex@andromeda" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG4jTPHOnfxvBOcVmExcU+j2u9Lsf1OoVG/ols2Met9/ scrumplex@dyson" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHGpFTRRx1FBilZA5epIadTK6GvUDNGdD288F3x6rO+z termux@void" - ]; -} diff --git a/nixosConfigurations/common/utils.nix b/nixosConfigurations/common/utils.nix deleted file mode 100644 index c8601bb3..00000000 --- a/nixosConfigurations/common/utils.nix +++ /dev/null @@ -1,22 +0,0 @@ -{pkgs, ...}: { - programs.mtr.enable = true; - programs.bandwhich.enable = true; - - environment.systemPackages = with pkgs; [ - dig - lsof - nload - tree - - pciutils - psmisc - usbutils - - p7zip - unzip - - man-pages - - vimv-rs - ]; -} diff --git a/nixosConfigurations/dyson/configuration.nix b/nixosConfigurations/dyson/configuration.nix index 1e5eb779..7c60af32 100644 --- a/nixosConfigurations/dyson/configuration.nix +++ b/nixosConfigurations/dyson/configuration.nix @@ -1,4 +1,5 @@ { + fpConfig, inputs, pkgs, ... @@ -9,10 +10,11 @@ ./desktop/niri.nix ./disks.nix ./keyd.nix - ./networkmanager.nix ./swapfile.nix ./wireguard.nix + fpConfig.flake.modules.nixos.laptop + inputs.nixos-facter-modules.nixosModules.facter inputs.nixos-hardware.nixosModules.framework-12th-gen-intel inputs.srvos.nixosModules.desktop diff --git a/nixosConfigurations/dyson/default.nix b/nixosConfigurations/dyson/default.nix index 8fdf7128..bea96728 100644 --- a/nixosConfigurations/dyson/default.nix +++ b/nixosConfigurations/dyson/default.nix @@ -3,7 +3,6 @@ hostName = "dyson"; modules = [ ../common - ../common/bat.nix ../common/beets.nix ../common/bluetooth.nix ../common/boot @@ -27,7 +26,6 @@ ../common/desktop/niri.nix ../common/desktop/obs.nix ../common/desktop/orca-slicer.nix - ../common/desktop/pipewire ../common/desktop/polkit-agent.nix ../common/desktop/portfolio-performance.nix ../common/desktop/poweralertd.nix @@ -45,15 +43,10 @@ ../common/git.nix ../common/gpg.nix ../common/home.nix - ../common/htop.nix ../common/libvirtd.nix - ../common/misc.nix ../common/mpd.nix ../common/mpv.nix ../common/neovim.nix - ../common/nix-index.nix - ../common/nix.nix - ../common/openssh.nix ../common/pkgs ../common/podman.nix ../common/printing.nix @@ -65,7 +58,6 @@ ../common/ssh.nix ../common/syncthing.nix ../common/tty.nix - ../common/utils.nix ../common/v4l2loopback.nix ../common/wireshark.nix diff --git a/nixosConfigurations/dyson/networkmanager.nix b/nixosConfigurations/dyson/networkmanager.nix deleted file mode 100644 index acabe3d1..00000000 --- a/nixosConfigurations/dyson/networkmanager.nix +++ /dev/null @@ -1,25 +0,0 @@ -{config, ...}: { - assertions = [ - { - assertion = !config.networking.nftables.enable; - message = "Wireguard isn't configured with networking.nftables.enable enabled"; - } - ]; - - networking.networkmanager.enable = true; - services.avahi.enable = true; - - hm = { - xsession.preferStatusNotifierItems = true; # needed for network-manager-applet - services.network-manager-applet.enable = true; - systemd.user.services."network-manager-applet" = { - Unit.After = ["graphical-session.target"]; - Service.Slice = ["background-graphical.slice"]; - }; - }; - - networking.firewall = { - trustedInterfaces = ["wg-home"]; - checkReversePath = false; - }; -}