os/flake.nix

67 lines
1.6 KiB
Nix
Raw Normal View History

2023-05-21 21:15:04 +02:00
{
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
home-manager.url = github:nix-community/home-manager;
pwnix = {
inputs.nixpkgs.follows = "nixpkgs";
url = git+https://im.badat.dev/bad/pwnix.git;
};
};
outputs = args@{ home-manager, nixpkgs, ... }: with nixpkgs; {
# Configurations for NixOS machines.
nixosConfigurations =
let mkUserConfig = path: {
imports = [ home-manager.nixosModules.home-manager ];
config = {
home-manager.users."riley" = a: lib.pipe a [
(import path)
(x: x // {
imports = [ ./shared/home ];
})
];
};
}; in {
# Desktop system
"thor" = lib.nixosSystem {
system = "x86_64-linux";
modules = [
(mkUserConfig ./system/thor/home.nix)
./system/thor/core.nix
./shared/core
];
specialArgs = args;
};
# Pinebook
"odin" = lib.nixosSystem {
system = "aarch64-linux";
modules = [
(mkUserConfig ./system/odin/home.nix)
./system/odin/core.nix
./shared/core
];
specialArgs = args;
};
};
# Configurations for non-NixOS machines.
homeConfigurations = {
"dev-lt-63" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."x86_64-linux";
2023-05-21 22:26:26 +02:00
modules = [
./system/dev-lt-63/home.nix
./shared/home
];
2023-05-21 21:15:04 +02:00
};
};
};
}