configuration.nix/flake.nix

141 lines
3.3 KiB
Nix
Raw Normal View History

2023-03-15 22:11:59 +05:30
{
2023-03-25 22:10:42 +05:30
description = "NixOS Configuration";
2023-03-15 22:11:59 +05:30
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable";
};
2023-08-05 14:36:01 +05:30
flake-utils = {
url = "github:numtide/flake-utils";
};
2023-04-01 23:20:13 +05:30
home-manager = {
2023-04-02 00:30:38 +05:30
url = "github:nix-community/home-manager";
2023-03-15 22:11:59 +05:30
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence = {
2023-04-02 00:30:38 +05:30
url = "github:nix-community/impermanence";
2023-03-15 22:11:59 +05:30
};
2023-04-01 23:20:13 +05:30
lanzaboote = {
url = "github:nix-community/lanzaboote";
2023-04-01 23:20:13 +05:30
inputs.nixpkgs.follows = "nixpkgs";
};
2023-07-28 16:24:59 +05:30
2023-08-04 18:04:51 +05:30
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-03-15 22:11:59 +05:30
};
2023-05-18 16:11:26 +05:30
outputs = {
self,
nixpkgs,
2023-08-05 14:36:01 +05:30
flake-utils,
2023-05-18 16:11:26 +05:30
home-manager,
impermanence,
lanzaboote,
2023-08-04 18:04:51 +05:30
nixvim,
} @ inputs: let
2023-08-05 14:04:52 +05:30
secrets = import ./secrets.nix;
2023-08-14 20:47:09 +05:30
config = {
allowUnfree = true;
};
2023-08-05 14:36:01 +05:30
in
{
nixosConfigurations = {
Skipper = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
2023-08-14 20:47:09 +05:30
inherit config;
2023-08-05 14:36:01 +05:30
overlays = [(import ./packages)];
};
2023-08-05 14:36:01 +05:30
specialArgs = inputs // {inherit secrets;};
modules = [
{
system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
}
2023-04-10 23:07:41 +05:30
2023-08-05 14:36:01 +05:30
home-manager.nixosModules.home-manager
impermanence.nixosModules.impermanence
lanzaboote.nixosModules.lanzaboote
2023-04-10 23:07:41 +05:30
2023-08-05 14:36:01 +05:30
./common
./hosts/skipper
2023-08-05 14:36:01 +05:30
{
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = {inherit secrets;};
users.${secrets.users.primary.userName} = {pkgs, ...}: {
imports = [
impermanence.nixosModules.home-manager.impermanence
nixvim.homeManagerModules.nixvim
./home
];
};
};
2023-08-05 14:36:01 +05:30
}
];
};
2023-08-15 13:06:06 +05:30
Rico1 = nixpkgs.lib.nixosSystem rec {
system = "aarch64-linux";
pkgs = import nixpkgs {
inherit system;
inherit config;
};
specialArgs = inputs // {inherit secrets;};
modules = [
{
system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
}
nixvim.nixosModules.nixvim
./common
./hosts/rico1
];
};
2023-08-05 14:36:01 +05:30
Rico2 = nixpkgs.lib.nixosSystem rec {
system = "aarch64-linux";
pkgs = import nixpkgs {
inherit system;
2023-08-14 20:47:09 +05:30
inherit config;
};
2023-08-05 14:36:01 +05:30
specialArgs = inputs // {inherit secrets;};
modules = [
{
system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
}
2023-07-28 16:24:59 +05:30
2023-08-05 14:36:01 +05:30
nixvim.nixosModules.nixvim
2023-07-28 16:24:59 +05:30
2023-08-05 14:36:01 +05:30
./common
./hosts/rico2
];
};
2023-03-15 22:11:59 +05:30
};
2023-08-05 14:36:01 +05:30
}
// flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {
inherit system;
};
in
with pkgs; {
formatter = pkgs.alejandra;
devShells.default = mkShell {
buildInputs = [
2023-08-05 14:44:19 +05:30
git
2023-08-05 14:36:01 +05:30
git-crypt
2023-08-05 14:44:19 +05:30
statix
2023-08-05 14:36:01 +05:30
];
};
}
);
2023-03-15 22:11:59 +05:30
}