From 2ca8b405e86df387e4634692e4776ea6fcfac5ec Mon Sep 17 00:00:00 2001 From: Grey Jones Date: Fri, 28 Aug 2026 15:19:06 +0100 Subject: [PATCH] begin to create checks to make nixos modules home-manager independent --- dotfiles/global/vscode/keybindings.json | 16 ++ .../kitagawa/equibop/equicord-settings.json | 2 +- flake.lock | 187 +----------------- flake.nix | 18 +- modules/components/shells/noctalia.nix | 4 +- modules/components/window-managers/niri.nix | 4 +- modules/features/applications/gui/equibop.nix | 19 ++ modules/features/applications/gui/kitty.nix | 19 +- modules/features/applications/gui/vscode.nix | 16 +- modules/global/global.nix | 6 + modules/global/home.nix | 6 +- modules/global/options.nix | 2 +- modules/hosts/kitagawa/kitagawa.nix | 3 +- .../hardware-configuration.nix | 0 .../{nixos => system}/hardware-fixes.nix | 0 .../kitagawa/{nixos => system}/plymouth.nix | 0 modules/hosts/takamaki/takamaki.nix | 8 +- 17 files changed, 100 insertions(+), 210 deletions(-) rename modules/hosts/kitagawa/{nixos => system}/hardware-configuration.nix (100%) rename modules/hosts/kitagawa/{nixos => system}/hardware-fixes.nix (100%) rename modules/hosts/kitagawa/{nixos => system}/plymouth.nix (100%) diff --git a/dotfiles/global/vscode/keybindings.json b/dotfiles/global/vscode/keybindings.json index 7184bc4..b074099 100644 --- a/dotfiles/global/vscode/keybindings.json +++ b/dotfiles/global/vscode/keybindings.json @@ -6,5 +6,21 @@ { "command": "workbench.action.files.newFile", "key": "alt+enter" + }, + { + "key": "alt+right", + "command": "workbench.action.nextEditor" + }, + { + "key": "ctrl+pagedown", + "command": "-workbench.action.nextEditor" + }, + { + "key": "alt+left", + "command": "workbench.action.previousEditor" + }, + { + "key": "ctrl+pageup", + "command": "-workbench.action.previousEditor" } ] diff --git a/dotfiles/kitagawa/equibop/equicord-settings.json b/dotfiles/kitagawa/equibop/equicord-settings.json index cb85824..6391a83 100644 --- a/dotfiles/kitagawa/equibop/equicord-settings.json +++ b/dotfiles/kitagawa/equibop/equicord-settings.json @@ -4,7 +4,7 @@ "authenticated": false, "settingsSync": false, "url": "https://cloud.equicord.org/", - "settingsSyncVersion": 1787543449308 + "settingsSyncVersion": 1787926226537 }, "enableOnlineThemes": true, "enabledThemeLinks": [ diff --git a/flake.lock b/flake.lock index 4ed2fa8..11a8651 100644 --- a/flake.lock +++ b/flake.lock @@ -106,22 +106,6 @@ "type": "github" } }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1767039857, - "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", - "owner": "NixOS", - "repo": "flake-compat", - "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "flake-compat", - "type": "github" - } - }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -141,24 +125,6 @@ } }, "flake-parts_2": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib_2" - }, - "locked": { - "lastModified": 1787559586, - "narHash": "sha256-onL0VLf9vPllmT0H/OlURIU5r5t5WIEl7t4tVNKT0Nw=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "9d0d87172c374f89da73c1cfe6d81ae62feac1f1", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-parts_3": { "inputs": { "nixpkgs-lib": [ "stylix", @@ -269,55 +235,18 @@ "type": "github" } }, - "nix-cachyos-kernel": { - "inputs": { - "flake-compat": "flake-compat", - "flake-parts": "flake-parts_2", - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1787594581, - "narHash": "sha256-C0Ckqq9K/XMIWKW/OFeIkKipMXc6Qc3eFMiY4w7Iv8o=", - "owner": "xddxdd", - "repo": "nix-cachyos-kernel", - "rev": "be42f230afd6789046dc99c4479236d4061fe7e1", - "type": "github" - }, - "original": { - "owner": "xddxdd", - "ref": "release", - "repo": "nix-cachyos-kernel", - "type": "github" - } - }, - "nix-flatpak": { - "locked": { - "lastModified": 1767983141, - "narHash": "sha256-7ZCulYUD9RmJIDULTRkGLSW1faMpDlPKcbWJLYHoXcs=", - "owner": "gmodena", - "repo": "nix-flatpak", - "rev": "440818969ac2cbd77bfe025e884d0aa528991374", - "type": "github" - }, - "original": { - "owner": "gmodena", - "ref": "latest", - "repo": "nix-flatpak", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1787574585, - "narHash": "sha256-lYyM+zbWl1jCJ5xSxPzCkPtxO3OXMst8+QfboXRQCcs=", - "owner": "NixOS", + "lastModified": 1787498568, + "narHash": "sha256-9i/VTdusq/+NM/tz+J1Re+ojkMB8MBf0QshnYfzHz30=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "09cf6aa915e6e042f74607067dffa237084ff53e", + "rev": "56c02bc00adcf003215cc4bd996d6efaf4cff188", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixos-unstable-small", + "owner": "nixos", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -337,53 +266,6 @@ "type": "github" } }, - "nixpkgs-lib_2": { - "locked": { - "lastModified": 1785031560, - "narHash": "sha256-OmshNvn2vupOFpYinLUu+1Dnpu4n7Q5N3ggGVNHpkUI=", - "owner": "nix-community", - "repo": "nixpkgs.lib", - "rev": "0e79af5e3d4dcfcd676ab5ba3f95d2e3352e078c", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixpkgs.lib", - "type": "github" - } - }, - "nixpkgs-mesa-overlay": { - "locked": { - "lastModified": 1770837850, - "narHash": "sha256-kHUN55l4Nqa1ODhItVDBOpKcdP1wQJM+STy7H+7/ARQ=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "e4f9df8a27c2b4871c665368e65bdb6852dd93e6", - "type": "github" - }, - "original": { - "owner": "nixos", - "repo": "nixpkgs", - "rev": "e4f9df8a27c2b4871c665368e65bdb6852dd93e6", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1787498568, - "narHash": "sha256-9i/VTdusq/+NM/tz+J1Re+ojkMB8MBf0QshnYfzHz30=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "56c02bc00adcf003215cc4bd996d6efaf4cff188", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "noctalia": { "inputs": { "nixpkgs": [ @@ -429,29 +311,6 @@ "type": "github" } }, - "plasma-manager": { - "inputs": { - "home-manager": [ - "home-manager" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1785762349, - "narHash": "sha256-jZhZkzAwc7f3exzcTDJWP2WCAchCv0iNC3UF/QsahdQ=", - "owner": "nix-community", - "repo": "plasma-manager", - "rev": "a19a2a029fa180911bd89c554dca1616e10f4c1d", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "plasma-manager", - "type": "github" - } - }, "root": { "inputs": { "firefox-addons": "firefox-addons", @@ -459,15 +318,10 @@ "home-manager": "home-manager", "import-tree": "import-tree", "nh": "nh", - "nix-cachyos-kernel": "nix-cachyos-kernel", - "nix-flatpak": "nix-flatpak", - "nixpkgs": "nixpkgs_2", - "nixpkgs-mesa-overlay": "nixpkgs-mesa-overlay", + "nixpkgs": "nixpkgs", "noctalia": "noctalia", - "plasma-manager": "plasma-manager", "spicetify": "spicetify", - "stylix": "stylix", - "zen-browser": "zen-browser" + "stylix": "stylix" } }, "spicetify": { @@ -498,7 +352,7 @@ "base16-helix": "base16-helix", "base16-vim": "base16-vim", "firefox-gnome-theme": "firefox-gnome-theme", - "flake-parts": "flake-parts_3", + "flake-parts": "flake-parts_2", "gnome-shell": "gnome-shell", "nixpkgs": [ "nixpkgs" @@ -618,29 +472,6 @@ "repo": "base16-zed", "type": "github" } - }, - "zen-browser": { - "inputs": { - "home-manager": [ - "home-manager" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1787540616, - "narHash": "sha256-c+dIgStaq3qNaQxhAiiXY3upNTIdn7tCcqPnwsmKTmY=", - "owner": "0xc000022070", - "repo": "zen-browser-flake", - "rev": "51df7b8cbb0fcba14a9b159531ef48d0cd69dde9", - "type": "github" - }, - "original": { - "owner": "0xc000022070", - "repo": "zen-browser-flake", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index e26a49a..9478c00 100644 --- a/flake.nix +++ b/flake.nix @@ -8,7 +8,7 @@ import-tree.url = "github:vic/import-tree"; - nixpkgs-mesa-overlay.url = "github:nixos/nixpkgs/e4f9df8a27c2b4871c665368e65bdb6852dd93e6"; + #nixpkgs-mesa-overlay.url = "github:nixos/nixpkgs/e4f9df8a27c2b4871c665368e65bdb6852dd93e6"; home-manager = { url = "github:nix-community/home-manager"; @@ -25,22 +25,22 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - zen-browser = { + /* zen-browser = { url = "github:0xc000022070/zen-browser-flake"; inputs.nixpkgs.follows = "nixpkgs"; inputs.home-manager.follows = "home-manager"; - }; + }; */ firefox-addons = { url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; inputs.nixpkgs.follows = "nixpkgs"; }; - plasma-manager = { + /* plasma-manager = { url = "github:nix-community/plasma-manager"; inputs.nixpkgs.follows = "nixpkgs"; inputs.home-manager.follows = "home-manager"; - }; + }; */ noctalia = { url = "github:noctalia-dev/noctalia"; @@ -52,14 +52,14 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - /*nixos-millennium = { + /* nixos-millennium = { url = "git+https://git.greyweather.dev/greyweather/nixos-millennium"; inputs.nixpkgs.follows = "nixpkgs"; - };*/ + }; */ - nix-cachyos-kernel.url = "github:xddxdd/nix-cachyos-kernel/release"; + #nix-cachyos-kernel.url = "github:xddxdd/nix-cachyos-kernel/release"; - nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=latest"; + #nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=latest"; }; outputs = inputs@{ self, flake-parts, import-tree, ... }: flake-parts.lib.mkFlake { inherit inputs; } (import-tree ./modules); diff --git a/modules/components/shells/noctalia.nix b/modules/components/shells/noctalia.nix index 5dcf8aa..23fc36b 100644 --- a/modules/components/shells/noctalia.nix +++ b/modules/components/shells/noctalia.nix @@ -8,7 +8,7 @@ programs.noctalia.enable = true; home-manager.sharedModules = [ - { + ({ lib, config, ... }: { home.activation = { symlinkNoctaliaState = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript { target = ".local/state/noctalia/settings.toml"; @@ -24,7 +24,7 @@ xdg.configFile."noctalia/settings.toml".source = "${self}/dotfiles/${config.info.hostName}/noctalia/settings.toml"; xdg.configFile."noctalia/plugins".source = "${self}/dotfiles/${config.info.hostName}/noctalia/plugins"; - } + }) ]; }; }; diff --git a/modules/components/window-managers/niri.nix b/modules/components/window-managers/niri.nix index 72ce305..b1e0cc1 100644 --- a/modules/components/window-managers/niri.nix +++ b/modules/components/window-managers/niri.nix @@ -38,12 +38,12 @@ }; home-manager.sharedModules = [ - { + ({ lib, config, ... }: { home.activation.symlinkNiriConfig = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript { target = ".config/niri/config.kdl"; source = "dotfiles/${config.info.hostName}/niri.kdl"; }); - } + }) ]; }; }; diff --git a/modules/features/applications/gui/equibop.nix b/modules/features/applications/gui/equibop.nix index 672d376..7d1d42c 100644 --- a/modules/features/applications/gui/equibop.nix +++ b/modules/features/applications/gui/equibop.nix @@ -1,4 +1,23 @@ { inputs, self, ... }: { + flake.nixosModules.graphics = { pkgs, lib, config, ...}: { + options.features.applications.gui.equibop.enable = lib.mkEnableOption "equibop"; + + config = let + mkIfElse = with lib; p: yes: no: mkMerge [ + (mkIf p yes) + (mkIf (!p) no) + ]; + in lib.mkIf (config.features.applications.gui.equibop.enable) (mkIfElse (config.features.nixos.home-manager.enable) { + home-manager.sharedModules = [ + { + features.applications.gui.equibop.enable = lib.mkDefault true; + } + ]; + } { + environment.systemPackages = [ pkgs.equibop ]; + }); + }; + flake.homeModules.graphics = { pkgs, lib, config, ... }: { options.features.applications.gui.equibop.enable = lib.mkEnableOption "equibop"; diff --git a/modules/features/applications/gui/kitty.nix b/modules/features/applications/gui/kitty.nix index a910a09..c7e4144 100644 --- a/modules/features/applications/gui/kitty.nix +++ b/modules/features/applications/gui/kitty.nix @@ -2,11 +2,20 @@ flake.nixosModules.graphics = { pkgs, config, lib, ... }: { options.features.applications.gui.kitty.enable = lib.mkEnableOption "kitty"; - config.home-manager.sharedModules = lib.mkIf (config.features.applications.gui.kitty.enable) [ - { - features.applications.gui.kitty.enable = true; - } - ]; + config = let + mkIfElse = with lib; p: yes: no: mkMerge [ + (mkIf p yes) + (mkIf (!p) no) + ]; + in lib.mkIf (config.features.applications.gui.kitty.enable) (mkIfElse (config.features.nixos.home-manager.enable) { + home-manager.sharedModules = [ + { + features.applications.gui.kitty.enable = lib.mkDefault true; + } + ]; + } { + environment.systemPackages = [ pkgs.kitty ]; + }); }; flake.homeModules.graphics = { pkgs, config, lib, ... }: { diff --git a/modules/features/applications/gui/vscode.nix b/modules/features/applications/gui/vscode.nix index 1adccb1..b11989a 100644 --- a/modules/features/applications/gui/vscode.nix +++ b/modules/features/applications/gui/vscode.nix @@ -2,18 +2,22 @@ flake.nixosModules.graphics = { config, pkgs, lib, ... }: { options.features.applications.gui.vscode.enable = lib.mkEnableOption "vscode"; - config.home-manager.sharedModules = lib.mkIf (config.features.applications.gui.vscode.enable) [ - { - features.applications.gui.vscode.enable = true; - } - ]; + config = { + environment.systemPackages = [ pkgs.vscode ]; + + home-manager.sharedModules = lib.mkIf (config.features.applications.gui.vscode.enable) [ + { + features.applications.gui.vscode.enable = lib.mkDefault true; + } + ]; + }; }; flake.homeModules.graphics = { config, pkgs, lib, ... }: { options.features.applications.gui.vscode.enable = lib.mkEnableOption "vscode"; config = lib.mkIf (config.features.applications.gui.vscode.enable) { - home.packages = [ pkgs.vscode ]; + home.packages = lib.mkIf (config.info.isStandalone) [ pkgs.vscode ]; home.activation = { linkVsCodeConfigSettings = lib.hm.dag.entryAfter ["writeBoundary"] (config.helpers.mkSymlinkActivationScript { diff --git a/modules/global/global.nix b/modules/global/global.nix index 18e626c..18417e7 100644 --- a/modules/global/global.nix +++ b/modules/global/global.nix @@ -81,5 +81,11 @@ enable = true; powerOnBoot = false; }; + + home-manager.sharedModules = [ + ({ config, ... }: { + info.isStandalone = false; + }) + ]; }; } \ No newline at end of file diff --git a/modules/global/home.nix b/modules/global/home.nix index f8e8c52..091d98c 100644 --- a/modules/global/home.nix +++ b/modules/global/home.nix @@ -1,12 +1,14 @@ { inputs, self, ... }: { - flake.homeModules.global = { config, pkgs, ... }: { + flake.homeModules.global = { lib, config, pkgs, ... }: { nix.gc = { automatic = true; persistent = true; dates = "Sun 05:00"; }; - nixpkgs.config.allowUnfree = true; + nixpkgs.config = lib.mkIf (config.info.isStandalone) { + allowUnfree = true; + }; home = { stateVersion = config.info.stateVersion; diff --git a/modules/global/options.nix b/modules/global/options.nix index fb721a5..52fb513 100644 --- a/modules/global/options.nix +++ b/modules/global/options.nix @@ -52,7 +52,7 @@ isStandalone = lib.mkOption { type = lib.types.bool; - default = false; + default = true; }; }; diff --git a/modules/hosts/kitagawa/kitagawa.nix b/modules/hosts/kitagawa/kitagawa.nix index 69afeeb..50db8b2 100644 --- a/modules/hosts/kitagawa/kitagawa.nix +++ b/modules/hosts/kitagawa/kitagawa.nix @@ -35,6 +35,7 @@ gui = { kitty.enable = true; vscode.enable = true; + equibop.enable = true; }; extraPackages = with pkgs; [ @@ -97,7 +98,6 @@ }; gui = { - equibop.enable = true; floorp.enable = true; remmina.enable = true; spotify = { @@ -116,6 +116,7 @@ signal-desktop xarchiver kdePackages.filelight + kdePackages.kate loupe ]; }; diff --git a/modules/hosts/kitagawa/nixos/hardware-configuration.nix b/modules/hosts/kitagawa/system/hardware-configuration.nix similarity index 100% rename from modules/hosts/kitagawa/nixos/hardware-configuration.nix rename to modules/hosts/kitagawa/system/hardware-configuration.nix diff --git a/modules/hosts/kitagawa/nixos/hardware-fixes.nix b/modules/hosts/kitagawa/system/hardware-fixes.nix similarity index 100% rename from modules/hosts/kitagawa/nixos/hardware-fixes.nix rename to modules/hosts/kitagawa/system/hardware-fixes.nix diff --git a/modules/hosts/kitagawa/nixos/plymouth.nix b/modules/hosts/kitagawa/system/plymouth.nix similarity index 100% rename from modules/hosts/kitagawa/nixos/plymouth.nix rename to modules/hosts/kitagawa/system/plymouth.nix diff --git a/modules/hosts/takamaki/takamaki.nix b/modules/hosts/takamaki/takamaki.nix index eb0e434..f422fc0 100644 --- a/modules/hosts/takamaki/takamaki.nix +++ b/modules/hosts/takamaki/takamaki.nix @@ -2,18 +2,20 @@ flake.homeConfigurations.takamaki = inputs.home-manager.lib.homeManagerConfiguration { pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux; modules = with self.homeModules; [ - global - graphics takamaki ]; }; flake.homeModules.takamaki = { pkgs, config, lib, ... }: { + imports = with self.homeModules; [ + global + graphics + ]; + info = { rootPath = "/home/grey/flake"; hostName = "takamaki"; stateVersion = "26.11"; - isStandalone = true; }; features = {