nixos/flake.nix
2022-12-01 14:35:47 +01:00

75 lines
2.0 KiB
Nix

{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11";
nixos-unstable.url = "github:NixOS/nixpkgs/master";
home-manager = {
url = "github:nix-community/home-manager/release-22.11";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{ self, nixpkgs, nixos-unstable, home-manager }:
let
x64System = "x86_64-linux";
darwinSystem = "aarch64-darwin";
wrapPkgsSystem = { system }:
import nixpkgs rec {
inherit system;
unstable = wrapUnstablePkgsSystem { inherit system; };
config.allowUnfree = true;
overlays = [
(final: prev: { inherit unstable; })
];
};
wrapUnstablePkgsSystem = { system }:
import nixos-unstable {
inherit system;
config.allowUnfree = true;
};
pkgsX64 = wrapPkgsSystem { system = x64System; };
unstableX64 = wrapUnstablePkgsSystem { system = x64System; };
utilsX64 = import ./lib {
inherit nixpkgs nixos-unstable home-manager;
pkgs = pkgsX64;
unstable = unstableX64;
system = x64System;
};
pkgsDarwin = wrapPkgsSystem { system = darwinSystem; };
unstableDarwin = wrapUnstablePkgsSystem { system = darwinSystem; };
utilsDarwin = import ./lib {
inherit nixpkgs nixos-unstable home-manager;
pkgs = pkgsDarwin;
unstable = unstableDarwin;
system = darwinSystem;
};
in
{
nixosConfigurations = {
architect = utilsX64.host.mkHost {
name = "architect";
users = [{
user = "giulio";
roles = [ ];
}];
};
gAluminum = utilsX64.host.mkHost {
name = "gAluminum";
users = [{
user = "giulio";
roles = [ "desktop" "ssh" "git" ];
}];
roles = [ "gnome" ];
};
};
homeConfigurations.giulioMac = utilsDarwin.user.mkHMUser {
name = "giulio";
roles = [ "ssh" ];
};
};
}