From a739d6de6d98434744106998956208294bf87fdf Mon Sep 17 00:00:00 2001 From: Amneesh Singh Date: Wed, 8 Mar 2023 06:50:15 +0530 Subject: [PATCH] rearrange hosts a bit Signed-off-by: Amneesh Singh --- hosts/default.nix | 6 ++-- hosts/marisa/default.nix | 5 +-- .../{marisa/stuff.nix => modules/minimal.nix} | 25 +++++++++++++- hosts/modules/server.nix | 34 ------------------- hosts/modules/sound.nix | 1 + hosts/modules/x86builder.nix | 14 -------- hosts/remilia/default.nix | 4 +-- hosts/remilia/stuff.nix | 32 ----------------- 8 files changed, 32 insertions(+), 89 deletions(-) rename hosts/{marisa/stuff.nix => modules/minimal.nix} (51%) delete mode 100644 hosts/modules/server.nix delete mode 100644 hosts/modules/x86builder.nix delete mode 100644 hosts/remilia/stuff.nix diff --git a/hosts/default.nix b/hosts/default.nix index 532097a..71892ff 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -7,8 +7,7 @@ let globalArgs ]; personalModules = [ ./modules/sound.nix ]; - serverModules = [ ./modules/server.nix ]; - builders = [ ./modules/x86builder.nix ]; + serverModules = [ ./modules/minimal.nix ]; in { flake.nixosConfigurations = { @@ -43,8 +42,7 @@ in { nixpkgs.pkgs = self.legacyPackages.${system}; } ] ++ commonModules - ++ serverModules - ++ builders; + ++ serverModules; }; }; } diff --git a/hosts/marisa/default.nix b/hosts/marisa/default.nix index 7e12e2b..7bb8017 100644 --- a/hosts/marisa/default.nix +++ b/hosts/marisa/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, ... }: { imports = [ @@ -6,7 +6,8 @@ ./hardware.nix ./boot.nix ./services.nix - ./stuff.nix ]; + + time.timeZone = "Asia/Kolkata"; system.stateVersion = "21.05"; } diff --git a/hosts/marisa/stuff.nix b/hosts/modules/minimal.nix similarity index 51% rename from hosts/marisa/stuff.nix rename to hosts/modules/minimal.nix index 15d985c..493dac6 100644 --- a/hosts/marisa/stuff.nix +++ b/hosts/modules/minimal.nix @@ -1,6 +1,5 @@ { config, pkgs, ... }: { - time.timeZone = "Asia/Kolkata"; security = { sudo.enable = false; doas = { @@ -14,6 +13,18 @@ ]; }; }; + + environment.systemPackages = with pkgs; [ + git + htop + vim + wireguard-tools + rnix-lsp + nmap + gcc + postgresql #for the client cli + ]; + programs = { gnupg = { agent = { @@ -22,11 +33,23 @@ }; }; }; + nix = { package = pkgs.nixUnstable; extraOptions = '' experimental-features = nix-command flakes ''; settings.trusted-users = [ "root" ]; + buildMachines = [{ + hostName = "satori"; + systems = [ "x86_64-linux" "aarch64-linux" ]; + maxJobs = 4; + speedFactor = 2; + supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; + }]; + distributedBuilds = true; + extraOptions = '' + builders-use-substitutes = true + ''; }; } diff --git a/hosts/modules/server.nix b/hosts/modules/server.nix deleted file mode 100644 index 16803fa..0000000 --- a/hosts/modules/server.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ config, pkgs, ... }: -{ - environment.systemPackages = with pkgs; [ - git - htop - vim - wireguard-tools - rnix-lsp - nmap - gcc - postgresql #for the client cli - ]; - - programs = { - zsh = { - enable = true; - promptInit = "PROMPT='%B%F{cyan}%~ %F{blue}>%f%b '\nRPROMPT='%B%F{cyan}%n%f@%F{red}%m%b'"; - histSize = 12000; - enableCompletion = true; - syntaxHighlighting.enable = true; - autosuggestions = { - enable = true; - highlightStyle = "fg=yellow,bold"; - }; - ohMyZsh.enable = true; - }; - gnupg = { - agent = { - enable = true; - pinentryFlavor = "curses"; - }; - }; - }; -} diff --git a/hosts/modules/sound.nix b/hosts/modules/sound.nix index c002579..eecc080 100644 --- a/hosts/modules/sound.nix +++ b/hosts/modules/sound.nix @@ -12,6 +12,7 @@ socketActivation = true; wireplumber.enable = true; + # https://nixos.wiki/wiki/PipeWire#Low-latency_setup config.pipewire = { context.objects = [ { diff --git a/hosts/modules/x86builder.nix b/hosts/modules/x86builder.nix deleted file mode 100644 index b2ef2b0..0000000 --- a/hosts/modules/x86builder.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ config, ... }: -{ - nix.buildMachines = [{ - hostName = "satori"; - systems = [ "x86_64-linux" "aarch64-linux" ]; - maxJobs = 4; - speedFactor = 2; - supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; - }]; - nix.distributedBuilds = true; - nix.extraOptions = '' - builders-use-substitutes = true - ''; -} diff --git a/hosts/remilia/default.nix b/hosts/remilia/default.nix index f3ff3af..9438afe 100644 --- a/hosts/remilia/default.nix +++ b/hosts/remilia/default.nix @@ -1,4 +1,4 @@ -{ lib, config, ... }: +{ config, ... }: { imports = [ @@ -7,8 +7,8 @@ ./boot.nix ./services.nix ./mailserver.nix - ./stuff.nix ]; + time.timeZone = "Asia/Kolkata"; system.stateVersion = "21.11"; } diff --git a/hosts/remilia/stuff.nix b/hosts/remilia/stuff.nix deleted file mode 100644 index 15d985c..0000000 --- a/hosts/remilia/stuff.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ config, pkgs, ... }: -{ - time.timeZone = "Asia/Kolkata"; - security = { - sudo.enable = false; - doas = { - enable = true; - extraRules = [ - { - users = [ ]; - keepEnv = true; - persist = true; - } - ]; - }; - }; - programs = { - gnupg = { - agent = { - enable = true; - pinentryFlavor = "curses"; - }; - }; - }; - nix = { - package = pkgs.nixUnstable; - extraOptions = '' - experimental-features = nix-command flakes - ''; - settings.trusted-users = [ "root" ]; - }; -}