flake.nix refactor 2

This commit is contained in:
Your Name 2024-05-17 21:52:56 +03:00
parent c6f5084aa7
commit 6d0a7022f5

View file

@ -1,20 +1,23 @@
{ {
inputs = { inputs = {
secrets.url = "git+ssh://git@github.com/deltathetawastaken/secrets.git";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.11"; nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.11";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs2105.url = "github:NixOS/nixpkgs/nixos-21.05"; nixpkgs2105.url = "github:NixOS/nixpkgs/nixos-21.05";
home-manager.url = "github:nix-community/home-manager"; home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
anyrun.url = "github:anyrun-org/anyrun";
anyrun.inputs.nixpkgs.follows = "nixpkgs";
secrets.url = "git+ssh://git@github.com/deltathetawastaken/secrets.git";
nixvim.url = "github:nix-community/nixvim";
shwewo = { shwewo = {
url = "github:shwewo/flake"; url = "github:shwewo/flake";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "nixpkgs-stable"; inputs.nixpkgs-stable.follows = "nixpkgs-stable";
}; };
nixvim.url = "github:nix-community/nixvim";
anyrun.url = "github:anyrun-org/anyrun";
anyrun.inputs.nixpkgs.follows = "nixpkgs";
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
hyprland-contrib = { hyprland-contrib = {
url = "github:hyprwm/contrib"; url = "github:hyprwm/contrib";
@ -30,15 +33,10 @@
outputs = inputs@{ self, nixpkgs, home-manager, ... }: outputs = inputs@{ self, nixpkgs, home-manager, ... }:
let let
pkgs = nixpkgs.legacyPackages."x86_64-linux"; pkgs = nixpkgs.legacyPackages."x86_64-linux";
stable = import inputs.nixpkgs-stable { stable = import inputs.nixpkgs-stable { system = "x86_64-linux"; config = { allowUnfree = true; }; };
system = "x86_64-linux"; unstable = import inputs.nixpkgs-unstable { system = "x86_64-linux"; config = { allowUnfree = true; }; };
config = { allowUnfree = true; };
}; specialArgs = { inherit inputs self stable unstable homeSettings; };
unstable = import inputs.nixpkgs-unstable {
system = "x86_64-linux";
config = { allowUnfree = true; };
};
specialArgs = { inherit inputs self stable unstable homeSettings; }; #var coz shared between home and system
homeSettings.home-manager = { homeSettings.home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
@ -46,13 +44,14 @@
extraSpecialArgs = specialArgs; extraSpecialArgs = specialArgs;
}; };
makeSystem = name: systemModules: nixpkgs.lib.nixosSystem { makeSystem = name: pkgsVersion: systemModules: nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = specialArgs; specialArgs = specialArgs // { inherit pkgsVersion; };
modules = [ ./hosts/generic.nix ] ++ systemModules; modules = [ ./hosts/generic.nix ] ++ systemModules;
}; };
in { in {
devShells."x86_64-linux".default = pkgs.mkShell { devShells."x86_64-linux".default = pkgs.mkShell {
name = "delta"; name = "delta";
packages = with pkgs; [ gitleaks pre-commit ]; packages = with pkgs; [ gitleaks pre-commit ];
@ -60,9 +59,9 @@
}; };
nixosConfigurations = { nixosConfigurations = {
dlaptop = makeSystem "dlaptop" [ ./hosts/dlaptop/system.nix ]; dlaptop = makeSystem "dlaptop" unstable [ ./hosts/dlaptop/system.nix ];
intelnuc = makeSystem "intelnuc" [ ./hosts/intelnuc/system.nix ]; intelnuc = makeSystem "intelnuc" stable [ ./hosts/intelnuc/system.nix ];
huanan = makeSystem "huanan" [ ./hosts/huanan/system.nix ]; huanan = makeSystem "huanan" pkgs [ ./hosts/huanan/system.nix ];
}; };
}; };
} }