feat(flake): set up flake-parts
This commit is contained in:
parent
672f40ecd3
commit
d91a8d24d4
21
flake.lock
21
flake.lock
|
@ -100,6 +100,26 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1688466019,
|
||||
"narHash": "sha256-VeM2akYrBYMsb4W/MmBo1zmaMfgbL4cH3Pu8PGyIwJ0=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "8e8d955c22df93dbe24f19ea04f47a74adbdc5ec",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
|
@ -293,6 +313,7 @@
|
|||
"inputs": {
|
||||
"agenix": "agenix",
|
||||
"deploy-rs": "deploy-rs",
|
||||
"flake-parts": "flake-parts",
|
||||
"flake-utils": "flake-utils",
|
||||
"home-manager": "home-manager_2",
|
||||
"nixos-hardware": "nixos-hardware",
|
||||
|
|
105
flake.nix
105
flake.nix
|
@ -1,52 +1,61 @@
|
|||
{
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
|
||||
|
||||
inputs.nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
inputs.nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
||||
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
flake-parts = {
|
||||
url = "github:hercules-ci/flake-parts";
|
||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
inputs.home-manager = {
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-23.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
inputs.nur.url = "github:nix-community/NUR/master";
|
||||
nur.url = "github:nix-community/NUR/master";
|
||||
|
||||
inputs.agenix = {
|
||||
agenix = {
|
||||
url = "github:ryantm/agenix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
inputs.deploy-rs = {
|
||||
deploy-rs = {
|
||||
url = "github:serokell/deploy-rs";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.utils.follows = "flake-utils";
|
||||
};
|
||||
|
||||
inputs.pre-commit-hooks = {
|
||||
pre-commit-hooks = {
|
||||
url = "github:cachix/pre-commit-hooks.nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.nixpkgs-stable.follows = "nixpkgs";
|
||||
inputs.flake-utils.follows = "flake-utils";
|
||||
};
|
||||
|
||||
inputs.nvim-kitty-navigator = {
|
||||
nvim-kitty-navigator = {
|
||||
url = "github:hermitmaster/nvim-kitty-navigator";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, nixpkgs-unstable, nixos-hardware, flake-utils
|
||||
, home-manager, nur, agenix, deploy-rs, pre-commit-hooks
|
||||
outputs = { self, nixpkgs, nixpkgs-unstable, nixos-hardware, flake-parts
|
||||
, flake-utils, home-manager, nur, agenix, deploy-rs, pre-commit-hooks
|
||||
, nvim-kitty-navigator }@inputs:
|
||||
let
|
||||
nixpkgsConfig.allowUnfree = true;
|
||||
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems = [ "x86_64-linux" "aarch64-linux" ];
|
||||
imports = [ ];
|
||||
flake = rec {
|
||||
overlays = {
|
||||
unstable = final: prev: {
|
||||
unstable = import nixpkgs-unstable {
|
||||
inherit (prev) system;
|
||||
config = nixpkgsConfig;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
};
|
||||
neovim = final: prev:
|
||||
|
@ -68,22 +77,17 @@
|
|||
deconz = final.qt5.callPackage ./pkgs/deconz { };
|
||||
};
|
||||
wrappers = final: prev: {
|
||||
genericBinWrapper = final.callPackage ./pkgs/generic-bin-wrapper { };
|
||||
genericBinWrapper =
|
||||
final.callPackage ./pkgs/generic-bin-wrapper { };
|
||||
mullvadExcludeWrapper =
|
||||
final.callPackage ./pkgs/mullvad-exclude-wrapper { };
|
||||
};
|
||||
};
|
||||
nixosModules = {
|
||||
flakeDefaults = import ./modules/flakeDefaults.nix;
|
||||
systemdNotify = import ./modules/systemdNotify.nix;
|
||||
};
|
||||
homeManagerModules = {
|
||||
git = import ./home/modules/git.nix;
|
||||
firefox = import ./home/modules/firefox/firefox.nix;
|
||||
tor-browser = import ./home/modules/firefox/tor-browser.nix;
|
||||
};
|
||||
|
||||
lib = rec {
|
||||
systemDefaults = {
|
||||
modules = [ nixosModules.flakeDefaults agenix.nixosModules.default ];
|
||||
modules =
|
||||
[ nixosModules.flakeDefaults agenix.nixosModules.default ];
|
||||
overlays = with overlays; [
|
||||
unstable
|
||||
nur.overlay
|
||||
|
@ -92,7 +96,6 @@
|
|||
wrappers
|
||||
];
|
||||
};
|
||||
lib = rec {
|
||||
createSystem = hostName:
|
||||
{ hardwareConfig, config }:
|
||||
({ pkgs, lib, ... }: {
|
||||
|
@ -102,7 +105,7 @@
|
|||
|
||||
imports = systemDefaults.modules ++ [ hardwareConfig config ];
|
||||
|
||||
environment.systemPackages = with pkgs;
|
||||
environment.systemPackages =
|
||||
[ agenix.packages.x86_64-linux.default ];
|
||||
});
|
||||
createUser' = import ./lib/createUser.nix;
|
||||
|
@ -111,12 +114,20 @@
|
|||
(createUser' name args) ({ inherit home-manager; } // args2));
|
||||
createMediaGroup = _: { users.groups.media.gid = 600; };
|
||||
};
|
||||
specialArgs = { inherit inputs; };
|
||||
in rec {
|
||||
|
||||
inherit lib overlays nixosModules homeManagerModules;
|
||||
nixosModules = {
|
||||
flakeDefaults = import ./modules/flakeDefaults.nix;
|
||||
systemdNotify = import ./modules/systemdNotify.nix;
|
||||
};
|
||||
|
||||
nixosConfigurations.home-pc = nixpkgs.lib.nixosSystem {
|
||||
homeManagerModules = {
|
||||
git = import ./home/modules/git.nix;
|
||||
firefox = import ./home/modules/firefox/firefox.nix;
|
||||
tor-browser = import ./home/modules/firefox/tor-browser.nix;
|
||||
};
|
||||
|
||||
nixosConfigurations = {
|
||||
home-pc = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
nixpkgs.nixosModules.notDetected
|
||||
|
@ -135,14 +146,13 @@
|
|||
config = ./home/felschr.nix;
|
||||
})
|
||||
({ pkgs, ... }: {
|
||||
environment.systemPackages = with pkgs;
|
||||
environment.systemPackages =
|
||||
[ deploy-rs.defaultPackage.x86_64-linux ];
|
||||
})
|
||||
];
|
||||
inherit specialArgs;
|
||||
specialArgs = { inherit inputs; };
|
||||
};
|
||||
|
||||
nixosConfigurations.pilot1 = nixpkgs.lib.nixosSystem {
|
||||
pilot1 = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
nixpkgs.nixosModules.notDetected
|
||||
|
@ -159,10 +169,9 @@
|
|||
config = ./home/felschr-work.nix;
|
||||
})
|
||||
];
|
||||
inherit specialArgs;
|
||||
specialArgs = { inherit inputs; };
|
||||
};
|
||||
|
||||
nixosConfigurations.home-server = nixpkgs.lib.nixosSystem {
|
||||
home-server = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
nixpkgs.nixosModules.notDetected
|
||||
|
@ -185,7 +194,8 @@
|
|||
config = ./home/felschr-server.nix;
|
||||
})
|
||||
];
|
||||
inherit specialArgs;
|
||||
specialArgs = { inherit inputs; };
|
||||
};
|
||||
};
|
||||
|
||||
deploy.nodes.home-server = {
|
||||
|
@ -196,16 +206,8 @@
|
|||
self.nixosConfigurations.home-server;
|
||||
};
|
||||
};
|
||||
|
||||
} // flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config = nixpkgsConfig;
|
||||
};
|
||||
in rec {
|
||||
formatter = pkgs.nixfmt;
|
||||
|
||||
perSystem = { system, config, pkgs, ... }: rec {
|
||||
packages = { deconz = pkgs.qt5.callPackage ./pkgs/deconz { }; };
|
||||
|
||||
apps = { deconz = flake-utils.lib.mkApp { drv = packages.deconz; }; };
|
||||
|
@ -222,5 +224,8 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
formatter = pkgs.nixfmt;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue