config/flake.nix

99 lines
2.8 KiB
Nix
Raw Normal View History

2022-02-05 21:42:36 +02:00
{
description = "System and user config";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
2022-05-30 22:20:39 +03:00
nix-super.url = "git+https://git.privatevoid.net/max/nix-super-fork.git";
2022-02-05 21:42:36 +02:00
home-manager.url = "github:nix-community/home-manager/master";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
2022-05-30 22:20:39 +03:00
nix-crx.url = "git+https://git.privatevoid.net/max/nix-crx.git";
2022-02-05 21:42:36 +02:00
nix-crx.inputs.nixpkgs.follows = "nixpkgs";
deploy-rs.url = "github:serokell/deploy-rs";
deploy-rs.inputs.nixpkgs.follows = "nixpkgs";
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
2022-03-01 23:48:07 +02:00
2022-05-30 22:43:59 +03:00
helix.url = "github:helix-editor/helix";
2022-03-01 23:48:07 +02:00
helix.inputs.nixpkgs.follows = "nixpkgs";
2022-02-05 21:42:36 +02:00
kernel-clr = { url = "github:clearlinux-pkgs/linux"; flake = false; };
add dream2nix flake.lock: Update Flake lock file updates: • Added input 'dream2nix': 'github:nix-community/dream2nix/6882b065624a15245a62d7ceac23be675d6e36f8' (2022-03-15) • Added input 'dream2nix/alejandra': 'github:kamadorueda/alejandra/511c3f6a88b6964e1496fb6f441f4ae5e58bd3ea' (2022-03-04) • Added input 'dream2nix/alejandra/flakeCompat': 'github:edolstra/flake-compat/b7547d3eed6f32d06102ead8991ec52ab0a4f1a7' (2022-01-03) • Added input 'dream2nix/alejandra/nixpkgs': follows 'dream2nix/nixpkgs' • Added input 'dream2nix/crane': 'github:ipetkov/crane/fc7a94f841347c88f2cb44217b2a3faa93e2a0b2' (2022-02-13) • Added input 'dream2nix/flake-utils-pre-commit': 'github:numtide/flake-utils/3cecb5b042f7f209c56ffd8371b2711a290ec797' (2022-02-07) • Added input 'dream2nix/gomod2nix': 'github:tweag/gomod2nix/67f22dd738d092c6ba88e420350ada0ed4992ae8' (2021-07-29) • Added input 'dream2nix/mach-nix': 'github:DavHau/mach-nix/4433f74a97b94b596fa6cd9b9c0402104aceef5d' (2021-10-20) • Added input 'dream2nix/nixpkgs': follows 'nixpkgs' • Added input 'dream2nix/node2nix': 'github:svanderburg/node2nix/644e90c0304038a446ed53efc97e9eb1e2831e71' (2021-10-22) • Added input 'dream2nix/poetry2nix': 'github:nix-community/poetry2nix/aee8f04296c39d88155e05d25cfc59dfdd41cc77' (2021-09-30) • Added input 'dream2nix/pre-commit-hooks': 'github:cachix/pre-commit-hooks.nix/b6bc0b21e1617e2b07d8205e7fae7224036dfa4b' (2022-03-01) • Added input 'dream2nix/pre-commit-hooks/flake-utils': follows 'dream2nix/flake-utils-pre-commit' • Added input 'dream2nix/pre-commit-hooks/nixpkgs': follows 'dream2nix/nixpkgs'
2022-03-17 20:59:46 +02:00
dream2nix.url = "github:nix-community/dream2nix";
dream2nix.inputs.nixpkgs.follows = "nixpkgs";
2022-02-05 21:42:36 +02:00
};
outputs = { self, nixpkgs, home-manager, nixos-hardware, ... }@inputs:
let
inherit (nixpkgs) lib;
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
};
deploy-rs-lib = inputs.deploy-rs.lib.${system};
agenixModule = inputs.agenix.nixosModules.age;
aspect = import ./modules inputs;
hosts = import ./hosts;
specialArgs = { inherit inputs hosts aspect; };
mkNixOS' = lib: name: lib.nixosSystem {
inherit system;
inherit specialArgs;
modules = [ hosts."${name}".nixos ];
};
mkNixOS = mkNixOS' nixpkgs.lib;
in {
nixosModules = aspect.modules;
nixosConfigurations =
lib.genAttrs [ "TITAN" "jericho" ] mkNixOS;
deploy.nodes = with deploy-rs-lib; {
TITAN = {
hostname = "titan.hypr";
profiles.system = {
user = "root";
path = activate.nixos self.nixosConfigurations.TITAN;
};
};
jericho = {
hostname = "jericho.hypr";
profiles.system = {
user = "root";
path = activate.nixos self.nixosConfigurations.jericho;
};
};
};
packages.${system} = import ./packages {
2022-03-17 21:02:48 +02:00
inherit inputs pkgs;
2022-02-05 21:42:36 +02:00
};
defaultApp.${system} = {
type = "app";
program = self.packages.${system}.flake-installer.outPath;
};
hydraJobs = {
systems.${system} = lib.mapAttrs (_: x: x.config.system.build.toplevel) self.nixosConfigurations;
packages = self.packages;
};
homeConfigurations = {
max = inputs.home-manager.lib.homeManagerConfiguration {
inherit system;
homeDirectory = "/home/max";
username = "max";
configuration.imports = [ ./users/max/home.nix ];
extraSpecialArgs = { inherit inputs; };
};
};
};
}