nixos-config/flake.nix
Antoine Martin bdd0748620 flake: switch back entire config to unstable
Mixing stable and unstable brought me weird problems, so I'm switching
back to unstable entirely until it breaks hard enough to convince me to
go back to stable. :)
2021-08-19 23:34:41 +02:00

151 lines
3.7 KiB
Nix

{
description = "Nixos configuration with flakes";
inputs = {
nixpkgs = {
type = "github";
owner = "NixOS";
repo = "nixpkgs";
ref = "nixos-unstable";
};
nixpkgs-unstable-small = {
type = "github";
owner = "NixOS";
repo = "nixpkgs";
ref = "nixos-unstable-small";
};
emacs-overlay = {
type = "github";
owner = "nix-community";
repo = "emacs-overlay";
ref = "master";
};
home-manager = {
type = "github";
owner = "nix-community";
repo = "home-manager";
ref = "release-21.05";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils = {
type = "github";
owner = "numtide";
repo = "flake-utils";
ref = "master";
};
nixos-hardware = {
type = "github";
owner = "NixOS";
repo = "nixos-hardware";
ref = "master";
};
};
outputs = { self, nixpkgs, home-manager, ... } @inputs: {
nixosModules = {
home = {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.alarsyo = import ./home;
home-manager.verbose = true;
};
};
nixosConfigurations =
let
system = "x86_64-linux";
shared_overlays = [
(self: super: {
packages = import ./pkgs { pkgs = super; };
# packages accessible through pkgs.unstable.package
unstable = import inputs.nixpkgs-unstable-small {
inherit system;
config.allowUnfree = true;
};
})
];
in {
poseidon = nixpkgs.lib.nixosSystem rec {
inherit system;
modules = [
./poseidon.nix
home-manager.nixosModule
self.nixosModules.home
{
nixpkgs.overlays = [
(self: super: {
fastPython3 = self.python3.override {
enableOptimizations = true;
reproducibleBuild = false;
self = self.fastPython3;
pythonAttr = "fastPython3";
};
matrix-synapse = super.matrix-synapse.override {
python3 = self.fastPython3;
};
})
] ++ shared_overlays;
}
];
};
boreal = nixpkgs.lib.nixosSystem rec {
inherit system;
modules = [
./boreal.nix
home-manager.nixosModule
self.nixosModules.home
{
nixpkgs.overlays = [
inputs.emacs-overlay.overlay
# uncomment this to build everything from scratch, fun but takes a
# while
#
# (self: super: {
# stdenv = super.impureUseNativeOptimizations super.stdenv;
# })
] ++ shared_overlays;
}
];
};
zephyrus = nixpkgs.lib.nixosSystem rec {
inherit system;
modules = [
./zephyrus.nix
inputs.nixos-hardware.nixosModules.common-cpu-intel
inputs.nixos-hardware.nixosModules.common-pc-laptop
inputs.nixos-hardware.nixosModules.common-pc-ssd
home-manager.nixosModule
self.nixosModules.home
{
nixpkgs.overlays = [
inputs.emacs-overlay.overlay
] ++ shared_overlays;
}
];
};
};
} // inputs.flake-utils.lib.eachDefaultSystem (system: {
packages =
inputs.flake-utils.lib.flattenTree
(import ./pkgs { pkgs = import nixpkgs { inherit system; }; });
});
}