From c9902751ca1bada6f0d7d7f3319add5147c4c19f Mon Sep 17 00:00:00 2001 From: lucy Date: Mon, 31 Aug 2026 14:36:32 +0200 Subject: [PATCH 1/2] split up flake --- flake.nix | 18 ++----------- hosts.nix | 23 ++++++++++++++++ modules/home.nix | 49 +++++++++++++++++++++++----------- modules/hosts/nerv/#nerv.nix# | 9 +++++++ modules/hosts/nerv/#theme.nix# | 23 ---------------- modules/hosts/nerv/.#nerv.nix | 1 + modules/hosts/nerv/.#theme.nix | 1 - modules/hosts/nerv/theme.nix | 25 +++++++++++++---- 8 files changed, 89 insertions(+), 60 deletions(-) create mode 100644 hosts.nix create mode 100644 modules/hosts/nerv/#nerv.nix# delete mode 100644 modules/hosts/nerv/#theme.nix# create mode 120000 modules/hosts/nerv/.#nerv.nix delete mode 120000 modules/hosts/nerv/.#theme.nix diff --git a/flake.nix b/flake.nix index 90d02cd..6b91667 100644 --- a/flake.nix +++ b/flake.nix @@ -27,23 +27,9 @@ wrappers.flakeModules.wrappers ./modules/theme.nix ./modules/programs/emacs/emacs.nix + ./hosts.nix ]; - flake.nixosConfigurations.nerv = inputs.nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs; }; - modules = [ - base16.nixosModule - { scheme = "${inputs.tt-schemes}/base16/oxocarbon-dark.yaml"; } - ./modules/hosts/nerv/configuration.nix - config.flake.wrappers.emacs.install - { wrappers.emacs.enable = true; } - home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.extraSpecialArgs = { inherit inputs; }; - home-manager.users.lucy = ./modules/home.nix; - } - ]; - }; + } ); } diff --git a/hosts.nix b/hosts.nix new file mode 100644 index 0000000..43bd10b --- /dev/null +++ b/hosts.nix @@ -0,0 +1,23 @@ +{ inputs, config, ... }: +let + themeName = "catppuccin-mocha"; +in +{ + flake.nixosConfigurations.nerv = inputs.nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + modules = [ + inputs.base16.nixosModules + { scheme = "${inputs.tt-schemes}/base16/${themeName}"; } + config.wrappers.emacs.install + ./configuration.nix + ./modules/theme.nix + ./modules/programs/emacs/emacs.nix + inputs.home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { inherit inputs; }; + } + ]; + }; +} diff --git a/modules/home.nix b/modules/home.nix index 3b8d960..e73ed4e 100644 --- a/modules/home.nix +++ b/modules/home.nix @@ -1,23 +1,18 @@ { - inputs, pkgs, config, ... }: let - c = ((pkgs.callPackage inputs.base16.lib { }).mkSchemeAttrs config.theme.name).withHashtag; + c = config.scheme.withHashtag; in { - home.stateVersion = "26.05"; - gtk = { - enable = true; - colorScheme = "dark"; - cursorTheme = { - name = "macOS"; - package = pkgs.apple-cursor; - size = 24; - }; - gtk3.extraCss = '' + home-manager.users.lucy = { + home.stateVersion = "26.05"; + gtk = { + enable = true; + colorScheme = "dark"; + gtk3.extraCss = '' @define-color theme_bg_color ${c.base00}; @define-color theme_fg_color ${c.base05}; @define-color theme_base_color ${c.base00}; @@ -30,8 +25,32 @@ in @define-color warning_color ${c.base0A}; @define-color error_color ${c.base08}; @define-color success_color ${c.base0B}; - ''; - + ''; + gtk4.extraCss = '' + @define-color window_bg_color ${c.base00}; + @define-color window_fg_color ${c.base05}; + @define-color view_bg_color ${c.base00}; + @define-color view_fg_color ${c.base05}; + @define-color headerbar_bg_color ${c.base01}; + @define-color headerbar_fg_color ${c.base05}; + @define-color headerbar_border_color ${c.base02}; + @define-color sidebar_bg_color ${c.base01}; + @define-color sidebar_fg_color ${c.base05}; + @define-color card_bg_color ${c.base01}; + @define-color card_fg_color ${c.base05}; + @define-color popover_bg_color ${c.base01}; + @define-color popover_fg_color ${c.base05}; + @define-color dialog_bg_color ${c.base01}; + @define-color dialog_fg_color ${c.base05}; + @define-color accent_bg_color ${c.base0D}; + @define-color accent_fg_color ${c.base00}; + @define-color accent_color ${c.base0D}; + @define-color destructive_bg_color ${c.base08}; + @define-color destructive_color ${c.base08}; + @define-color warning_color ${c.base0A}; + @define-color error_color ${c.base08}; + @define-color success_color ${c.base0B}; + ''; + }; }; - } diff --git a/modules/hosts/nerv/#nerv.nix# b/modules/hosts/nerv/#nerv.nix# new file mode 100644 index 0000000..150d2b9 --- /dev/null +++ b/modules/hosts/nerv/#nerv.nix# @@ -0,0 +1,9 @@ +{ inputs, ... }: { + flake.nixosConfigurations.nerv = inputs.nixpkgs.lib.nixosSystem { + modules = [ + ./configuration.nix + + ]; + }; +} + \ No newline at end of file diff --git a/modules/hosts/nerv/#theme.nix# b/modules/hosts/nerv/#theme.nix# deleted file mode 100644 index 129ecf5..0000000 --- a/modules/hosts/nerv/#theme.nix# +++ /dev/null @@ -1,23 +0,0 @@ -{ - inputs, - config, - lib, - ... -}: -let - schemeName = config.theme.name; -in -{ - config, - lib, - pkgs, - ... -}: - -let - scheme = (pkgs.callPackage inputs.base16.lib { }).mkSchemeAttrs schemeName; -in -{ - - -} diff --git a/modules/hosts/nerv/.#nerv.nix b/modules/hosts/nerv/.#nerv.nix new file mode 120000 index 0000000..3242c7a --- /dev/null +++ b/modules/hosts/nerv/.#nerv.nix @@ -0,0 +1 @@ +lucy@nerv.50314:1788169501 \ No newline at end of file diff --git a/modules/hosts/nerv/.#theme.nix b/modules/hosts/nerv/.#theme.nix deleted file mode 120000 index 42dbbad..0000000 --- a/modules/hosts/nerv/.#theme.nix +++ /dev/null @@ -1 +0,0 @@ -lucy@nerv.31959:1788169501 \ No newline at end of file diff --git a/modules/hosts/nerv/theme.nix b/modules/hosts/nerv/theme.nix index 33117a8..0186fc3 100644 --- a/modules/hosts/nerv/theme.nix +++ b/modules/hosts/nerv/theme.nix @@ -1,7 +1,22 @@ -{ inputs, config, lib, ... }: let +{ + inputs, + config, + lib, + ... +}: +let schemeName = config.theme.name; in - {config, lib, pkgs, ...}: - - let scheme = (pkgs.callPackage inputs.base16.lib {}).mkSchemeAttrs schemeName; in - {} +{ + config, + lib, + pkgs, + ... +}: +let + scheme = (pkgs.callPackage inputs.base16.lib { }).mkSchemeAttrs schemeName; +in +{ + options.scheme = lib.mkOption {type = lib.types.str; }; + config.scheme = scheme; +} From ec66697d146270afd2dd7f80b70ddf72a65060b0 Mon Sep 17 00:00:00 2001 From: lucy Date: Mon, 31 Aug 2026 14:51:10 +0200 Subject: [PATCH 2/2] split up flake and use emacs as nixos module --- flake.nix | 1 - hosts.nix | 20 +++++--- modules/hosts/nerv/configuration.nix | 71 +++++++++++++++------------- modules/hosts/nerv/theme.nix | 22 --------- modules/programs/emacs/emacs.nix | 7 +-- 5 files changed, 55 insertions(+), 66 deletions(-) delete mode 100644 modules/hosts/nerv/theme.nix diff --git a/flake.nix b/flake.nix index 6b91667..7a66712 100644 --- a/flake.nix +++ b/flake.nix @@ -26,7 +26,6 @@ imports = [ wrappers.flakeModules.wrappers ./modules/theme.nix - ./modules/programs/emacs/emacs.nix ./hosts.nix ]; diff --git a/hosts.nix b/hosts.nix index 43bd10b..02474eb 100644 --- a/hosts.nix +++ b/hosts.nix @@ -6,18 +6,26 @@ in flake.nixosConfigurations.nerv = inputs.nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs; }; modules = [ - inputs.base16.nixosModules - { scheme = "${inputs.tt-schemes}/base16/${themeName}"; } - config.wrappers.emacs.install - ./configuration.nix - ./modules/theme.nix - ./modules/programs/emacs/emacs.nix + inputs.base16.nixosModule + { scheme = "${inputs.tt-schemes}/base16/${themeName}.yaml"; } + ./modules/hosts/nerv/configuration.nix + ./modules/home.nix inputs.home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { inherit inputs; }; } + { + imports = [ + (inputs.wrappers.lib.getInstallModule { + name = "emacs"; + value = inputs.wrappers.lib.wrapperModules.emacs; + }) + ./modules/programs/emacs/emacs.nix + ]; + + } ]; }; } diff --git a/modules/hosts/nerv/configuration.nix b/modules/hosts/nerv/configuration.nix index 258f6fa..d4df98f 100644 --- a/modules/hosts/nerv/configuration.nix +++ b/modules/hosts/nerv/configuration.nix @@ -1,10 +1,14 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { - imports = - [ - ./hardware-configuration.nix - ]; + imports = [ + ./hardware-configuration.nix + ]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; @@ -19,43 +23,42 @@ hardware.graphics.enable = true; services.xserver.videoDrivers = [ "nvidia" ]; hardware.nvidia = { - modesetting.enable = true; - powerManagement.enable = false; - open = true; - nvidiaSettings = true; - package = config.boot.kernelPackages.nvidiaPackages.stable; -}; + modesetting.enable = true; + powerManagement.enable = false; + open = true; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; # Set your time zone. time.timeZone = "Europe/Berlin"; - i18n.defaultLocale = "en_US.UTF-8"; - services.desktopManager.gnome.enable = true; - services.displayManager.gdm.enable = true; - services.xserver.xkb.layout = "us"; - services.pipewire = { - enable = true; - pulse.enable = true; + i18n.defaultLocale = "en_US.UTF-8"; + services.desktopManager.gnome.enable = true; + services.displayManager.gdm.enable = true; + services.xserver.xkb.layout = "us"; + services.pipewire = { + enable = true; + pulse.enable = true; }; nixpkgs.config.allowUnfree = true; - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.lucy = { - isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. - packages = with pkgs; [ - vesktop - google-chrome - ]; - }; + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.lucy = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + packages = with pkgs; [ + vesktop + google-chrome + ]; + }; - environment.systemPackages = with pkgs; [ - fastfetch - wget - git - clang - ]; + environment.systemPackages = with pkgs; [ + fastfetch + wget + git + clang + ]; system.stateVersion = "26.05"; # Did you read the comment? } - diff --git a/modules/hosts/nerv/theme.nix b/modules/hosts/nerv/theme.nix deleted file mode 100644 index 0186fc3..0000000 --- a/modules/hosts/nerv/theme.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - inputs, - config, - lib, - ... -}: -let - schemeName = config.theme.name; -in -{ - config, - lib, - pkgs, - ... -}: -let - scheme = (pkgs.callPackage inputs.base16.lib { }).mkSchemeAttrs schemeName; -in -{ - options.scheme = lib.mkOption {type = lib.types.str; }; - config.scheme = scheme; -} diff --git a/modules/programs/emacs/emacs.nix b/modules/programs/emacs/emacs.nix index 81d8c6b..8d6e2b1 100644 --- a/modules/programs/emacs/emacs.nix +++ b/modules/programs/emacs/emacs.nix @@ -5,10 +5,10 @@ ... }: let - schemeName = config.theme.name; + schemeName = config.scheme; in { - flake.wrappers.emacs = + wrappers.emacs = { pkgs, wlib, @@ -17,7 +17,8 @@ in let scheme = (pkgs.callPackage inputs.base16.lib { }).mkSchemeAttrs schemeName; in - { + { + enable = true; imports = [ wlib.wrapperModules.emacs ];