From c2eead8fdf8756fab78b58096eb82ae26df4fd8e Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 12 May 2025 19:10:37 +0100 Subject: [PATCH] Add nixpad configuration The initial step of grouping lemp11 and t490 configuration, inspired by https://github.com/mkellyxp/nixbook. --- hosts/lemp11/configuration.nix | 5 ++--- hosts/lemp11/services.nix | 3 --- hosts/t490/configuration.nix | 4 ++-- hosts/t490/services/default.nix | 5 ----- modules/nixos/default.nix | 1 + modules/nixos/nixpad/default.nix | 37 ++++++++++++++++++++++++++++++++ 6 files changed, 42 insertions(+), 13 deletions(-) create mode 100644 modules/nixos/nixpad/default.nix diff --git a/hosts/lemp11/configuration.nix b/hosts/lemp11/configuration.nix index 0c7c292c..3b3ac5ce 100644 --- a/hosts/lemp11/configuration.nix +++ b/hosts/lemp11/configuration.nix @@ -18,6 +18,8 @@ desktop.media.makemkv.enable = true; + nixpad.enable = true; + # Bootloader. boot = { loader = { @@ -49,11 +51,8 @@ vscodium ]; - system.autoUpgrade.enable = true; - environment.systemPackages = with pkgs; [ fastfetch htop - libreoffice ]; } diff --git a/hosts/lemp11/services.nix b/hosts/lemp11/services.nix index 0a219ba0..a096651f 100644 --- a/hosts/lemp11/services.nix +++ b/hosts/lemp11/services.nix @@ -27,9 +27,6 @@ layout = "gb"; variant = ""; }; - - desktopManager.cinnamon.enable = true; - displayManager.lightdm.enable = true; }; }; } diff --git a/hosts/t490/configuration.nix b/hosts/t490/configuration.nix index cdd65522..0a8ff092 100644 --- a/hosts/t490/configuration.nix +++ b/hosts/t490/configuration.nix @@ -17,6 +17,8 @@ desktop.dconf.enable = true; + nixpad.enable = true; + boot = { loader = { systemd-boot = { @@ -35,6 +37,4 @@ ''; networking.networkmanager.enable = true; - - system.autoUpgrade.enable = true; } diff --git a/hosts/t490/services/default.nix b/hosts/t490/services/default.nix index 810ef869..ce7ea823 100644 --- a/hosts/t490/services/default.nix +++ b/hosts/t490/services/default.nix @@ -26,10 +26,5 @@ throttled.enable = true; thermald.enable = true; upower.enable = true; - - xserver = { - desktopManager.cinnamon.enable = true; - displayManager.lightdm.enable = true; - }; }; } diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index b1188b61..e75d5dfd 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -4,5 +4,6 @@ ./core ./desktop ./homelab + ./nixpad ]; } diff --git a/modules/nixos/nixpad/default.nix b/modules/nixos/nixpad/default.nix new file mode 100644 index 00000000..a6577a46 --- /dev/null +++ b/modules/nixos/nixpad/default.nix @@ -0,0 +1,37 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + cfg = config.nixpad; +in +{ + options.nixpad = { + enable = lib.mkEnableOption "Enable nixpad configuration"; + }; + + config = lib.mkIf cfg.enable { + services.xserver = { + enable = true; + + desktopManager.cinnamon.enable = true; + displayManager.lightdm.enable = true; + }; + + programs.firefox.enable = true; + + environment.systemPackages = with pkgs; [ + git + libreoffice + ]; + + nix.gc = { + automatic = true; + dates = "Mon 4:00"; + options = "--delete-older-than 30d"; + }; + }; +}