nixos-config/flake.nix

184 lines
4.6 KiB
Nix
Raw Normal View History

2024-09-22 01:04:11 -04:00
# flake.nix
{
inputs = {
2024-12-21 15:35:54 -05:00
nixos-hardware.url = "github:NixOS/nixos-hardware";
2024-09-24 16:11:23 -04:00
2025-02-04 13:13:24 -05:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
2024-09-22 01:04:11 -04:00
2025-02-08 10:27:43 -05:00
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11";
2024-10-05 12:36:08 -04:00
home-manager = {
2025-02-04 13:13:24 -05:00
url = "github:nix-community/home-manager";
2024-10-05 12:36:08 -04:00
inputs.nixpkgs.follows = "nixpkgs";
};
2024-09-23 23:35:58 -04:00
2024-12-31 12:05:58 -05:00
nix-flatpak.url = "github:gmodena/nix-flatpak"; # unstable branch
2024-09-25 23:50:11 -04:00
2025-02-06 22:46:37 -05:00
yazi = {
url = "github:sxyazi/yazi";
inputs.nixpkgs.follows = "nixpkgs";
};
2025-02-04 13:13:24 -05:00
emacs-overlay.url = "github:nix-community/emacs-overlay";
2025-02-07 18:15:39 -05:00
nix-rice = {
url = "github:bertof/nix-rice";
inputs.nixpkgs.follows = "nixpkgs";
};
2025-02-06 22:46:37 -05:00
kmonad = {
url = "github:kmonad/kmonad?dir=nix";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprlock = {
url = "github:hyprwm/hyprlock";
inputs.nixpkgs.follows = "nixpkgs";
};
hypridle = {
url = "github:hyprwm/hypridle";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-09-28 21:03:16 -04:00
2025-02-06 22:46:37 -05:00
musnix = {
2024-09-28 21:03:16 -04:00
url = "github:musnix/musnix";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-10-02 12:11:23 -04:00
# audio = {
# url = "git+https://gt.emenel.ca/emenel/audio.nix.git";
# inputs.nixpkgs.follows = "nixpkgs";
# };
2025-02-05 12:33:25 -05:00
2024-12-21 15:35:54 -05:00
wezterm = {
url = "github:wez/wezterm?dir=nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2025-01-01 13:18:25 -05:00
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2025-01-03 23:23:35 -05:00
affinity-nix = {
url = "github:mrshmllow/affinity-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2025-01-19 16:00:05 -05:00
isd = {
url = "github:isd-project/isd";
inputs.nixpkgs.follows = "nixpkgs";
};
2025-01-27 15:34:15 -05:00
niri = {
2025-02-06 13:56:58 -05:00
url = "github:sodiboo/niri-flake";
2025-01-27 15:34:15 -05:00
inputs.nixpkgs.follows = "nixpkgs";
};
2024-09-22 01:04:11 -04:00
};
2025-02-06 22:46:37 -05:00
outputs =
{
nixpkgs,
home-manager,
self,
...
2025-02-18 13:01:44 -05:00
} @inputs:
2025-02-04 13:13:24 -05:00
let
2025-02-04 16:27:59 -05:00
inherit (nixpkgs.lib) genAttrs replaceStrings;
2025-02-04 13:13:24 -05:00
inherit (nixpkgs.lib.filesystem) packagesFromDirectoryRecursive listFilesRecursive;
forAllSystems =
function:
genAttrs [
"x86_64-linux"
] (system: function nixpkgs.legacyPackages.${system});
nameOf = path: replaceStrings [ ".nix" ] [ "" ] (baseNameOf (toString path));
in
2025-02-06 22:46:37 -05:00
{
packages = forAllSystems (
pkgs:
packagesFromDirectoryRecursive {
inherit (pkgs) callPackage;
directory = ./packages;
}
);
2025-02-08 23:50:39 -05:00
pkgs-stable = inputs.nixpkgs-stable.legacyPackages.x86_64-linux;
2025-02-06 22:46:37 -05:00
nixosModules = genAttrs (map nameOf (listFilesRecursive ./modules/system)) (
name: import ./modules/system/${name}.nix
);
homeModules = genAttrs (map nameOf (listFilesRecursive ./modules/home)) (
name: import ./modules/home/${name}.nix
);
overlays = genAttrs (map nameOf (listFilesRecursive ./overlays)) (
name: import ./overlays/${name}.nix
);
nixosConfigurations = {
eddie = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
nix-config = self;
2025-02-08 10:27:43 -05:00
pkgs-stable = inputs.nixpkgs-stable {
config.allowUnfree = true;
};
2025-02-04 13:13:24 -05:00
};
2025-02-06 22:46:37 -05:00
modules = [
inputs.kmonad.nixosModules.default
inputs.musnix.nixosModules.musnix
inputs.niri.nixosModules.niri
inputs.sops-nix.nixosModules.sops
2025-02-20 16:23:09 -05:00
home-manager.nixosModules.home-manager
2025-02-08 10:27:43 -05:00
2025-02-06 22:46:37 -05:00
./hosts/eddie/configuration.nix
2025-02-04 13:13:24 -05:00
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
2025-02-08 10:27:43 -05:00
backupFileExtension = "bak";
sharedModules = [
inputs.nix-flatpak.homeManagerModules.nix-flatpak
inputs.sops-nix.homeManagerModules.sops
];
extraSpecialArgs = {
inherit inputs;
nix-config = self;
2025-02-09 20:20:17 -05:00
pkgs-stable = inputs.nixpkgs-stable {
config.allowUnfree = true;
};
};
users.emenel = import ./homes/emenel/default.nix;
};
}
2025-02-06 22:46:37 -05:00
];
2024-12-31 12:05:58 -05:00
};
2025-02-20 16:23:09 -05:00
media-server = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
nix-config = self;
pkgs-stable = inputs.nixpkgs-stable {
config.allowUnfree = true;
};
};
modules = [
inputs.sops-nix.nixosModules.sops
./hosts/media-server/configuration.nix
];
};
2024-09-22 01:15:13 -04:00
};
2025-02-06 22:46:37 -05:00
};
2024-09-22 01:04:11 -04:00
}