dotfiles/flake.nix

131 lines
4.0 KiB
Nix
Raw Normal View History

2022-06-02 03:32:14 +02:00
{
description = "dandellion's home-manager profiles";
2022-06-08 20:32:33 +02:00
2023-11-30 04:32:11 +01:00
# nixConfig.extra-substituters = ["https://cache.dodsorf.as"];
# nixConfig.exta-trusted-public-keys = "cache.dodsorf.as:FYKGadXTyI2ax8mirBTOjEqS/8PZKAWxiJVOBjESQXc=";
2022-06-02 03:32:14 +02:00
inputs = {
2024-12-05 21:32:39 +01:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
2022-12-01 21:14:53 +01:00
2024-12-05 21:32:39 +01:00
home-manager.url = "github:nix-community/home-manager/release-24.11";
2022-12-01 21:14:53 +01:00
home-manager.inputs.nixpkgs.follows = "nixpkgs";
2022-06-02 03:32:14 +02:00
unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
2024-10-21 04:46:50 +02:00
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
2022-06-02 03:32:14 +02:00
nur.url = "github:nix-community/NUR";
2023-01-16 06:58:04 +01:00
dan.url = "git+https://git.dodsorf.as/Dandellion/NUR.git"; #"git+https://git.dodsorf.as/Dandellion/NUR";
2022-06-02 03:32:14 +02:00
dan.inputs.nixpkgs.follows = "unstable";
2024-05-26 00:49:00 +02:00
2024-08-17 03:58:06 +02:00
wack-server-conf.url = "github:WackAttackCTF/wack-server-conf";
wack-server-conf.inputs.nixpkgs.follows = "nixpkgs";
2024-11-01 10:20:53 +01:00
wack-ctf.url = "github:WackAttackCTF/wack-ctf-flake";
wack-ctf.inputs.nixpkgs.follows = "nixpkgs";
2024-05-26 00:49:00 +02:00
greg-clients.url = "git+https://git.pvv.ntnu.no/Projects/grzegorz-clients";
greg-clients.inputs.nixpkgs.follows = "unstable";
2022-06-08 04:56:02 +02:00
2023-05-19 10:02:27 +02:00
# helix.url = "github:helix-editor/helix";
# helix.inputs.nixpkgs.follows = "unstable";
2022-09-09 02:49:19 +02:00
nixgl.url = "github:guibou/nixGL";
2022-12-01 21:14:53 +01:00
nixgl.inputs.nixpkgs.follows = "nixpkgs";
2022-06-02 03:32:14 +02:00
};
2024-10-21 04:46:50 +02:00
outputs = {self, nixpkgs, home-manager, unstable, nixos-hardware, nur, dan, nixgl, ... }@inputs:
2022-06-02 05:08:38 +02:00
let
nixlib = unstable.lib;
2024-10-21 04:46:50 +02:00
defaultOverlays = [
(final: prev: {
unstable = import unstable {
inherit (prev) system config;
};
dan = dan.packages.${prev.system};
grzegorz-clients = inputs.greg-clients.packages.${prev.system}.grzegorz-clients;
gregctl = inputs.greg-clients.packages.${prev.system}.grzegorzctl;
# helix = inputs.helix.packages.${prev.system}.helix;
2024-11-01 10:20:53 +01:00
wack = inputs.wack-ctf.packages.${prev.system}.wack;
2024-10-21 04:46:50 +02:00
})
nur.overlay
nixgl.overlay
];
mkHome =
{ machine
, configuration ? self.nixosModules.home-manager.${machine}
, system ? "x86_64-linux"
, username ? "daniel"
, homeDirectory ? "/home/${username}"
, stateVersion ? "22.05"
2024-11-01 10:20:53 +01:00
, extraSpecialArgs ? { overlays = defaultOverlays; }
}:
2022-12-01 21:14:53 +01:00
home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
modules = [
configuration
{
home = {
inherit username homeDirectory stateVersion;
};
}
];
inherit extraSpecialArgs;
};
2022-06-03 12:28:06 +02:00
mkHomes = machines: extraArgs: nixlib.genAttrs machines (machine: mkHome ({inherit machine; } // extraArgs));
allMachines = [ "laptop" "desktop" "headless" "pvv-terminal" ];
2022-06-02 05:08:38 +02:00
in
2022-06-02 03:32:14 +02:00
{
2022-06-08 05:48:18 +02:00
homeConfigurations = mkHomes [ "laptop" "headless" ] { }
// mkHomes [ "desktop" ] { username = "dan"; }
// mkHomes [ "pvv-terminal" ] { username = "danio"; homeDirectory = "/home/pvv/d/danio"; };
2022-06-02 05:08:38 +02:00
2024-08-17 03:58:06 +02:00
nixosConfigurations = {
2024-10-21 04:46:50 +02:00
ayanami = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [
./hosts/ayanami/configuration.nix
nixos-hardware.nixosModules.lenovo-thinkpad-l480
];
};
2024-08-17 03:58:06 +02:00
soryu = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [
./hosts/soryu/configuration.nix
];
};
};
nixosModules = {
home-manager = nixlib.genAttrs allMachines (machine: import ./home/machines/${machine}.nix);
2022-06-02 05:08:38 +02:00
};
homeActivations = nixlib.genAttrs allMachines (machine: self.homeConfigurations.${machine}.activationPackage);
apps.x86_64-linux = nixlib.genAttrs allMachines (machine: {
type = "app";
program = "${self.homeActivations.${machine}}/activate";
});
2024-11-01 12:20:53 +01:00
inherit defaultOverlays;
2022-06-09 02:21:48 +02:00
2024-10-21 04:46:50 +02:00
# hydraJobs = {
# laptop.x86_64-linux = self.homeActivations.laptop;
# desktop.x86_64-linux = self.homeActivations.desktop;
# };
2022-06-02 03:32:14 +02:00
};
2022-06-03 00:15:16 +02:00
}