From 21ce06c82dd310c2a60a2e4c4b393d1d5c3b3075 Mon Sep 17 00:00:00 2001 From: uku Date: Sun, 12 May 2024 13:33:15 +0200 Subject: [PATCH] feat: rearrange configs --- configs/client.nix | 15 +++++++++++++++ configs/common.nix | 15 +-------------- configs/desktop.nix | 15 --------------- configs/physical-computer.nix | 19 +++++++++++++++++++ configs/server.nix | 3 +++ systems/default.nix | 20 +++++++++++++++----- systems/etna/default.nix | 7 +------ 7 files changed, 54 insertions(+), 40 deletions(-) create mode 100644 configs/client.nix create mode 100644 configs/physical-computer.nix create mode 100644 configs/server.nix diff --git a/configs/client.nix b/configs/client.nix new file mode 100644 index 0000000..73a9c6d --- /dev/null +++ b/configs/client.nix @@ -0,0 +1,15 @@ +{pkgs, ...}: { + environment.systemPackages = with pkgs; [ + nil + ffmpeg + yt-dlp + hyfetch + ]; + + hm.programs.keychain = { + enable = true; + agents = ["ssh"]; + inheritType = "any"; + keys = ["id_ed25519"]; + }; +} diff --git a/configs/common.nix b/configs/common.nix index a88de32..c00b283 100644 --- a/configs/common.nix +++ b/configs/common.nix @@ -43,10 +43,6 @@ in { git curl wget - nil - ffmpeg - yt-dlp - hyfetch htop ]; @@ -55,16 +51,7 @@ in { }; }; - hm = { - home = {inherit stateVersion;}; - - programs.keychain = { - enable = true; - agents = ["ssh"]; - inheritType = "any"; - keys = ["id_ed25519"]; - }; - }; + hm.home = {inherit stateVersion;}; home-manager = { useGlobalPkgs = true; diff --git a/configs/desktop.nix b/configs/desktop.nix index 6dd16aa..f237c64 100644 --- a/configs/desktop.nix +++ b/configs/desktop.nix @@ -1,5 +1,4 @@ { - lib, pkgs, config, catppuccin, @@ -10,20 +9,8 @@ boot = { extraModulePackages = with config.boot.kernelPackages; [v4l2loopback]; kernelModules = ["v4l2loopback"]; - - loader = { - systemd-boot.enable = lib.mkForce false; - efi.canTouchEfiVariables = true; - }; - - lanzaboote = { - enable = true; - pkiBundle = "/etc/secureboot"; - }; }; - environment.systemPackages = with pkgs; [sbctl]; - fonts = { packages = with pkgs; [ iosevka @@ -76,8 +63,6 @@ (vesktop.override {withSystemVencord = false;}) wine-discord-ipc-bridge ]; - - stateVersion = "23.11"; }; services = { diff --git a/configs/physical-computer.nix b/configs/physical-computer.nix new file mode 100644 index 0000000..535046c --- /dev/null +++ b/configs/physical-computer.nix @@ -0,0 +1,19 @@ +{ + lib, + pkgs, + ... +}: { + boot = { + loader = { + systemd-boot.enable = lib.mkForce false; + efi.canTouchEfiVariables = true; + }; + + lanzaboote = { + enable = true; + pkiBundle = "/etc/secureboot"; + }; + }; + + environment.systemPackages = with pkgs; [sbctl]; +} diff --git a/configs/server.nix b/configs/server.nix new file mode 100644 index 0000000..0078cfb --- /dev/null +++ b/configs/server.nix @@ -0,0 +1,3 @@ +{ + services.tailscale.extraUpFlags = ["--advertise-exit-node"]; +} diff --git a/systems/default.nix b/systems/default.nix index 4067cd0..18c20f2 100644 --- a/systems/default.nix +++ b/systems/default.nix @@ -23,20 +23,29 @@ mapNixOS = lib.mapAttrs (toSystem inputs.nixpkgs.lib.nixosSystem); - nixos = with inputs; [ + _common = with inputs; [ ../configs/common.nix agenix.nixosModules.default home-manager.nixosModules.home-manager vscode-server.nixosModules.default ]; + physical-computer = with inputs; [ + ../configs/physical-computer.nix + lanzaboote.nixosModules.lanzaboote + ]; + + client = [../configs/client.nix] ++ _common; + + server = [../configs/server.nix] ++ _common; + desktop = with inputs; [ ../configs/desktop.nix - lanzaboote.nixosModules.lanzaboote catppuccin.nixosModules.catppuccin ] - ++ nixos; + ++ physical-computer + ++ client; in { flake.nixosConfigurations = mapNixOS { fuji = { @@ -47,7 +56,7 @@ in { fuji-wsl = { system = "x86_64-linux"; modules = - nixos + client ++ (with inputs; [ nixos-wsl.nixosModules.default ]); @@ -61,7 +70,8 @@ in { etna = { system = "x86_64-linux"; modules = - nixos + server + ++ physical-computer ++ (with inputs; [ api-rs.nixosModules.default ukubot-rs.nixosModules.default diff --git a/systems/etna/default.nix b/systems/etna/default.nix index 5faa6f9..5b90971 100644 --- a/systems/etna/default.nix +++ b/systems/etna/default.nix @@ -32,16 +32,11 @@ in { }; }; - boot = { - loader.systemd-boot.enable = true; - kernelPackages = lib.mkForce pkgs.linuxPackages_6_1; - }; + boot.kernelPackages = lib.mkForce pkgs.linuxPackages_6_1; services = { openssh.openFirewall = true; - tailscale.extraUpFlags = ["--advertise-exit-node"]; - cloudflared = { enable = true; tunnels.${tunnelId} = {