From 0e0a250ca05bd4e2a6f00eeec54b9f3ef8a59603 Mon Sep 17 00:00:00 2001 From: "RingOfStorms (Joshua Bell)" Date: Sun, 29 Dec 2024 03:11:30 -0600 Subject: [PATCH] tried to de HM the cosmic flake --- hosts/oren/flake.lock | 32 +++++++-------- hosts/oren/flake.nix | 19 +++++---- .../v1/active-page | 1 - modules/de_cosmic/flake.nix | 39 ++++++++++++++----- modules/home_manager/flake.nix | 1 + 5 files changed, 56 insertions(+), 36 deletions(-) delete mode 100644 modules/de_cosmic/config/com.system76.CosmicSettings/v1/active-page diff --git a/hosts/oren/flake.lock b/hosts/oren/flake.lock index 9d9f334..9f2ef8c 100644 --- a/hosts/oren/flake.lock +++ b/hosts/oren/flake.lock @@ -174,11 +174,11 @@ "locked": { "lastModified": 1, "narHash": "sha256-9Z/Z8Y4Q1q95zUeJWfUQFyeaAVkhb804kd3tiBpHfpI=", - "path": "/nix/store/sm477lnilan12wmmyd9s0dgphg6fqygf-source/modules/boot_systemd", + "path": "/nix/store/zcwx1l0ry5ikll5rpzlaxw8s5ygbs9r8-source/modules/boot_systemd", "type": "path" }, "original": { - "path": "/nix/store/sm477lnilan12wmmyd9s0dgphg6fqygf-source/modules/boot_systemd", + "path": "/nix/store/zcwx1l0ry5ikll5rpzlaxw8s5ygbs9r8-source/modules/boot_systemd", "type": "path" } }, @@ -192,11 +192,11 @@ "locked": { "lastModified": 1, "narHash": "sha256-tSW1S2JPkgnJ563taboMx0RfcyCbcO4+zsaTjPYPRvI=", - "path": "/nix/store/sm477lnilan12wmmyd9s0dgphg6fqygf-source/modules/common", + "path": "/nix/store/zcwx1l0ry5ikll5rpzlaxw8s5ygbs9r8-source/modules/common", "type": "path" }, "original": { - "path": "/nix/store/sm477lnilan12wmmyd9s0dgphg6fqygf-source/modules/common", + "path": "/nix/store/zcwx1l0ry5ikll5rpzlaxw8s5ygbs9r8-source/modules/common", "type": "path" } }, @@ -212,12 +212,12 @@ }, "locked": { "lastModified": 1, - "narHash": "sha256-kTwFBa1QFUbcld1+ZUOK2M0OjOpg6rzVGrkuAB8CemA=", - "path": "/nix/store/sm477lnilan12wmmyd9s0dgphg6fqygf-source/modules/de_cosmic", + "narHash": "sha256-FjZF4kam1l427FeIHKCFSV+GbXGpQPS46mWribdVK/U=", + "path": "/nix/store/zcwx1l0ry5ikll5rpzlaxw8s5ygbs9r8-source/modules/de_cosmic", "type": "path" }, "original": { - "path": "/nix/store/sm477lnilan12wmmyd9s0dgphg6fqygf-source/modules/de_cosmic", + "path": "/nix/store/zcwx1l0ry5ikll5rpzlaxw8s5ygbs9r8-source/modules/de_cosmic", "type": "path" } }, @@ -230,12 +230,12 @@ }, "locked": { "lastModified": 1, - "narHash": "sha256-9W9vNv25dFBOXVtiK8OeSrwU0epvI8y0dqdjfIEZhEc=", - "path": "/nix/store/sm477lnilan12wmmyd9s0dgphg6fqygf-source/modules/home_manager", + "narHash": "sha256-8aN/3ioMsr8IhBvo/Ym98bkFbHQ/4ODrww15W9b0i2g=", + "path": "/nix/store/zcwx1l0ry5ikll5rpzlaxw8s5ygbs9r8-source/modules/home_manager", "type": "path" }, "original": { - "path": "/nix/store/sm477lnilan12wmmyd9s0dgphg6fqygf-source/modules/home_manager", + "path": "/nix/store/zcwx1l0ry5ikll5rpzlaxw8s5ygbs9r8-source/modules/home_manager", "type": "path" } }, @@ -243,11 +243,11 @@ "locked": { "lastModified": 1, "narHash": "sha256-WfYwWhjnePj5MYb9d84AAH7DT4W77eXV7DE1HV5nWbk=", - "path": "/nix/store/sm477lnilan12wmmyd9s0dgphg6fqygf-source/modules/nebula", + "path": "/nix/store/zcwx1l0ry5ikll5rpzlaxw8s5ygbs9r8-source/modules/nebula", "type": "path" }, "original": { - "path": "/nix/store/sm477lnilan12wmmyd9s0dgphg6fqygf-source/modules/nebula", + "path": "/nix/store/zcwx1l0ry5ikll5rpzlaxw8s5ygbs9r8-source/modules/nebula", "type": "path" } }, @@ -258,11 +258,11 @@ "locked": { "lastModified": 1, "narHash": "sha256-Do761YmlKOOr9+9vKUJnA2n5WQANXKPR2aesvsi/6VQ=", - "path": "/nix/store/sm477lnilan12wmmyd9s0dgphg6fqygf-source/modules/neovim", + "path": "/nix/store/zcwx1l0ry5ikll5rpzlaxw8s5ygbs9r8-source/modules/neovim", "type": "path" }, "original": { - "path": "/nix/store/sm477lnilan12wmmyd9s0dgphg6fqygf-source/modules/neovim", + "path": "/nix/store/zcwx1l0ry5ikll5rpzlaxw8s5ygbs9r8-source/modules/neovim", "type": "path" } }, @@ -273,11 +273,11 @@ "locked": { "lastModified": 1, "narHash": "sha256-YjXJu/5Hcl7YpcpiHLd5wqCFUlJp39MM9CfQKhdpkk8=", - "path": "/nix/store/sm477lnilan12wmmyd9s0dgphg6fqygf-source/modules/stormd", + "path": "/nix/store/zcwx1l0ry5ikll5rpzlaxw8s5ygbs9r8-source/modules/stormd", "type": "path" }, "original": { - "path": "/nix/store/sm477lnilan12wmmyd9s0dgphg6fqygf-source/modules/stormd", + "path": "/nix/store/zcwx1l0ry5ikll5rpzlaxw8s5ygbs9r8-source/modules/stormd", "type": "path" } }, diff --git a/hosts/oren/flake.nix b/hosts/oren/flake.nix index b6bf154..9ec9225 100644 --- a/hosts/oren/flake.nix +++ b/hosts/oren/flake.nix @@ -108,16 +108,15 @@ ../../components/hm/zsh.nix ]; }; - root = { - imports = [ - # ../../components/hm/atuin.nix - ../../components/hm/nix_deprecations.nix - ../../components/hm/postgres.nix - ../../components/hm/starship.nix - ../../components/hm/zoxide.nix - ../../components/hm/zsh.nix - ]; - }; + # root = { + # imports = [ + # ../../components/hm/nix_deprecations.nix + # ../../components/hm/postgres.nix + # ../../components/hm/starship.nix + # ../../components/hm/zoxide.nix + # ../../components/hm/zsh.nix + # ]; + # }; }; }; }; diff --git a/modules/de_cosmic/config/com.system76.CosmicSettings/v1/active-page b/modules/de_cosmic/config/com.system76.CosmicSettings/v1/active-page deleted file mode 100644 index a8164e7..0000000 --- a/modules/de_cosmic/config/com.system76.CosmicSettings/v1/active-page +++ /dev/null @@ -1 +0,0 @@ -"display" \ No newline at end of file diff --git a/modules/de_cosmic/flake.nix b/modules/de_cosmic/flake.nix index 78a1874..d4fe5dc 100644 --- a/modules/de_cosmic/flake.nix +++ b/modules/de_cosmic/flake.nix @@ -23,15 +23,27 @@ pkgs, ... }: + let + cosmicConfigDir = ./config; + cosmicFiles = builtins.attrNames (builtins.readDir cosmicConfigDir); + cosmicConfigFiles = map (fileName: { + name = "cosmic/${fileName}"; + value = { + source = "${cosmicConfigDir}/${fileName}"; + # mode = "0644"; + }; + }) cosmicFiles; + cosmicConfigFilesAttrs = builtins.listToAttrs cosmicConfigFiles; + in with lib; { options.mods.de_cosmic = { users = mkOption { type = types.listOf types.str; description = "Users to apply cosmic DE settings to."; - default = [ - "root" - ] ++ (lib.optionals (config.mods.common.primaryUser != null) [ config.mods.common.primaryUser ]); + default = ( + lib.optionals (config.mods.common.primaryUser != null) [ config.mods.common.primaryUser ] + ); }; }; @@ -60,12 +72,21 @@ cosmic-store ]; - # Config - environment.etc = lib.mkIf (config.mods.de_cosmic.users != null) ( - lib.genAttrs config.mods.de_cosmic.users (user: { - source = ./config; - target = "/home/${user}/.config/cosmic"; - }) + # there are cosmic-greeter files in /var/lib/cosmic-greeter/ and ~/.local/state/cosmic + # Config TODO my attempt to make this not home-manager driven... + # environment.etc = cosmicConfigFilesAttrs; + # systemd.user.tmpfiles.rules = [ + # "L %h/.config/cosmic - - - - /etc/cosmic" + # ]; + + # Config TODO come up with a non home-manager way to do this. I dont want this flake to require home-manager from somewhere else to exist + home-manager.users = listToAttrs ( + map (name: { + inherit name; + value = { + xdg.configFile = cosmicConfigFilesAttrs; + }; + }) config.mods.de_cosmic.users ); }; }; diff --git a/modules/home_manager/flake.nix b/modules/home_manager/flake.nix index 8df150b..b6c4d92 100644 --- a/modules/home_manager/flake.nix +++ b/modules/home_manager/flake.nix @@ -39,6 +39,7 @@ home-manager.extraSpecialArgs = { nixConfig = config; }; + home-manager.backupFileExtension = "bak"; home-manager.users = mapAttrs' (name: user: { inherit name;