diff --git a/flake.lock b/flake.lock index 0ef2fd03..520641a8 100644 --- a/flake.lock +++ b/flake.lock @@ -629,11 +629,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1722375236, - "narHash": "sha256-8yrkwPN3TbCrtZSD/7GSV2kW9hruIZUQymnpyV15TI4=", + "lastModified": 1722441247, + "narHash": "sha256-YHVgiYZoaemwEI1/T0r8Q3iTGY1LPFJkBmLDVoqqea0=", "ref": "refs/heads/main", - "rev": "3b9b5346b830554aa7470ccf1202a7f3be72d1b4", - "revCount": 5029, + "rev": "8a5f9bbb394ddeb4be9a9df6248b41b07d84ea66", + "revCount": 5030, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -644,6 +644,27 @@ "url": "https://github.com/hyprwm/Hyprland" } }, + "hyprland-contrib": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1720709712, + "narHash": "sha256-78j/cY+AXoMIqqiNc1vWx237EPfpERAcYsb57ABUbwQ=", + "owner": "hyprwm", + "repo": "contrib", + "rev": "65d42dcbfde2229a75ccdb195c318dfe241f9ade", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "contrib", + "type": "github" + } + }, "hyprland-protocols": { "inputs": { "nixpkgs": [ @@ -1057,11 +1078,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1722425500, - "narHash": "sha256-nAVezKR8I1ny1dE7qbSdC1Z5uhFVmn6HnOC7eGBiutY=", + "lastModified": 1722431209, + "narHash": "sha256-qBxvnoQuzhCHTej5JMw1EpjavufRgpMNP9klpO7mbI4=", "owner": "nix-community", "repo": "nixvim", - "rev": "9314cd46f0f1ff756bae1ae1718c116be894930d", + "rev": "8945b3b5e336a42972448e2f07ed5bc465a40c83", "type": "github" }, "original": { @@ -1130,6 +1151,7 @@ "hardware": "hardware", "hm": "hm", "hyprland": "hyprland", + "hyprland-contrib": "hyprland-contrib", "lanzaboote": "lanzaboote", "nix-gaming": "nix-gaming", "nixpkgs": "nixpkgs_5", diff --git a/flake.nix b/flake.nix index 0206480c..511c1bb4 100644 --- a/flake.nix +++ b/flake.nix @@ -60,6 +60,10 @@ # cachyos chaotic.url = "https://flakehub.com/f/chaotic-cx/nyx/*.tar.gz"; hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; + hyprland-contrib = { + url = "github:hyprwm/contrib"; + inputs.nixpkgs.follows = "hyprland/nixpkgs"; + }; nix-gaming = { url = "github:fufexan/nix-gaming"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/home/core/gui/hypr/cnst.nix b/home/core/gui/hypr/cnst.nix index 9f13f926..04f58f4b 100644 --- a/home/core/gui/hypr/cnst.nix +++ b/home/core/gui/hypr/cnst.nix @@ -1,4 +1,8 @@ -{inputs, ...}: { +{ + inputs, + pkgs, + ... +}: { imports = [ inputs.hyprland.homeManagerModules.default ./land/cnst diff --git a/nixos/core/default.nix b/nixos/core/default.nix index cbca6619..cb2df4df 100644 --- a/nixos/core/default.nix +++ b/nixos/core/default.nix @@ -1,4 +1,22 @@ {pkgs, ...}: { + imports = [ + ./nix + ./xdg.nix + ./zsh.nix + ./fonts.nix + ./home-manager.nix + ./hyprland.nix + ]; + security = { + rtkit.enable = true; + pam.services.hyprlock = {}; + }; + + programs.dconf.enable = true; + + environment.localBinInPath = true; + + console.useXkbConfig = true; environment.systemPackages = with pkgs; [ anyrun stow diff --git a/nixos/default.nix b/nixos/default.nix index 11054f33..ab297f6b 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -1,10 +1,6 @@ let desktop = [ - ./core/hyprland.nix - ./core/xdg.nix - ./core/zsh.nix - ./core/fonts.nix - ./core/home-manager.nix + ./core ./locale diff --git a/nixos/hosts/cnix/default.nix b/nixos/hosts/cnix/default.nix index 854140a7..8308b678 100644 --- a/nixos/hosts/cnix/default.nix +++ b/nixos/hosts/cnix/default.nix @@ -7,6 +7,7 @@ system, ... }: let + homeDir = builtins.getEnv "HOME"; ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups; in { users.users.cnst = { @@ -33,12 +34,8 @@ in { ]; }; - programs.dconf.enable = true; - imports = [ - ./system.nix ./hardware-configuration.nix - ./substituters.nix ]; boot.kernelPackages = lib.mkForce pkgs.linuxPackages_cachyos; @@ -50,10 +47,6 @@ in { "splash" ]; - environment.sessionVariables = { - FLAKE = "/home/cnst/.nix-config"; - }; - # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion system.stateVersion = lib.mkDefault "23.11"; } diff --git a/nixos/hosts/cnix/substituters.nix b/nixos/hosts/cnix/substituters.nix deleted file mode 100644 index a892de4e..00000000 --- a/nixos/hosts/cnix/substituters.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ - nix.settings = { - substituters = [ - # high priority since it's almost always used - "https://cache.nixos.org?priority=10" - - "https://anyrun.cachix.org" - "https://fufexan.cachix.org" - "https://helix.cachix.org" - "https://hyprland.cachix.org" - "https://nix-community.cachix.org" - "https://nix-gaming.cachix.org" - "https://yazi.cachix.org" - ]; - - trusted-public-keys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - - "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s=" - "fufexan.cachix.org-1:LwCDjCJNJQf5XD2BV+yamQIMZfcKWR9ISIFy5curUsY=" - "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" - "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" - "yazi.cachix.org-1:Dcdz63NZKfvUCbDGngQDAZq6kOroIrFoyO064uvLh8k=" - ]; - }; -} diff --git a/nixos/hosts/cnix/system.nix b/nixos/hosts/cnix/system.nix index aa101332..6887dbfe 100644 --- a/nixos/hosts/cnix/system.nix +++ b/nixos/hosts/cnix/system.nix @@ -3,14 +3,18 @@ outputs, lib, config, + pkgs, ... -}: { +}: let + homeDir = builtins.getEnv "HOME"; +in { + environment.variables.FLAKE = "${homeDir}/.nix-config"; programs = { nh = { enable = true; clean.enable = true; clean.extraArgs = "--keep-since 4d --keep 3"; - flake = "/home/cnst/.nix-config"; + flake = "${homeDir}/.nix-config"; }; }; diff --git a/nixos/hosts/default.nix b/nixos/hosts/default.nix index 05bd48ea..1dd3fa0a 100644 --- a/nixos/hosts/default.nix +++ b/nixos/hosts/default.nix @@ -44,32 +44,59 @@ inputs.chaotic.nixosModules.default ]; }; + toothpc = nixosSystem { + inherit specialArgs; + modules = + desktop + ++ [ + ./toothpc + "${mod}/core" + "${mod}/core/lanzaboote.nix" + "${mod}/core/network/toothpc.nix" - # rog = nixosSystem { - # inherit specialArgs; - # modules = - # laptop - # ++ [ - # ./rog - # "${mod}/core/lanzaboote.nix" + "${mod}/hardware/toothpc.nix" - # "${mod}/programs/gamemode.nix" - # "${mod}/programs/hyprland.nix" - # "${mod}/programs/games.nix" + "${mod}/services/xserver/toothpc.nix" - # "${mod}/services/kanata" - # {home-manager.users.mihai.imports = homeImports."mihai@rog";} - # ]; - # }; + "${mod}/extra/gaming.nix" + "${mod}/extra/android" + "${mod}/extra/workstation" + { + home-manager = { + users.toothpick.imports = homeImports."toothpick@toothpc"; + extraSpecialArgs = specialArgs; + }; + } - # kiiro = nixosSystem { - # inherit specialArgs; - # modules = - # desktop - # ++ [ - # ./kiiro - # {home-manager.users.mihai.imports = homeImports.server;} - # ]; - # }; + # inputs.agenix.nixosModules.default + inputs.chaotic.nixosModules.default + ]; + }; + adampad = nixosSystem { + inherit specialArgs; + modules = + laptop + ++ [ + ./adampad + "${mod}/core" + "${mod}/core/network/adampad.nix" + + "${mod}/hardware/adampad.nix" + + "${mod}/services/xserver/adampad.nix" + "${mod}/services/blueman" + + "${mod}/extra/android" + { + home-manager = { + users.adam.imports = homeImports."adam@adampad"; + extraSpecialArgs = specialArgs; + }; + } + + # inputs.agenix.nixosModules.default + inputs.chaotic.nixosModules.default + ]; + }; }; } diff --git a/nixos/services/xserver/cnix.nix b/nixos/services/xserver/cnix.nix index fb7c9eb0..91515b65 100644 --- a/nixos/services/xserver/cnix.nix +++ b/nixos/services/xserver/cnix.nix @@ -1,4 +1,6 @@ -{config, ...}: { +let + homeDir = builtins.getEnv "HOME"; +in { services.xserver = { enable = true; videoDrivers = ["amdgpu"]; @@ -6,7 +8,7 @@ extraLayouts.hhkbse = { description = "HHKBse by cnst"; languages = ["se"]; - symbolsFile = /home/cnst/.nix-config/nixos/hosts/cnix/xkb/symbols/hhkbse; + symbolsFile = "${homeDir}/.nix-config/nixos/hosts/cnix/xkb/symbols/hhkbse"; }; layout = "hhkbse"; # dir = "/home/cnst/.nix-config/nixos/xkb"; diff --git a/pre-commit-hooks.nix b/pre-commit-hooks.nix deleted file mode 100644 index fcd5653f..00000000 --- a/pre-commit-hooks.nix +++ /dev/null @@ -1,15 +0,0 @@ -{inputs, ...}: { - imports = [inputs.pre-commit-hooks.flakeModule]; - - perSystem.pre-commit = { - settings.excludes = ["flake.lock"]; - - settings.hooks = { - alejandra.enable = true; - prettier = { - enable = true; - excludes = [".js" ".md" ".ts"]; - }; - }; - }; -}