nixos-config/flake.nix

119 lines
3 KiB
Nix

{
description = "Nixos configuration with flakes";
inputs = {
nixpkgs = {
type = "github";
owner = "NixOS";
repo = "nixpkgs";
ref = "nixos-21.05";
};
nixpkgs-unstable = {
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";
};
};
outputs = { self, nixpkgs, home-manager, ... } @inputs: {
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 {
inherit system;
config.allowUnfree = true;
};
})
];
in {
poseidon = nixpkgs.lib.nixosSystem rec {
inherit system;
modules = [
./poseidon.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.alarsyo = import ./home;
home-manager.verbose = true;
}
{
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.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.alarsyo = import ./home;
home-manager.verbose = true;
}
{
nixpkgs.overlays = [
inputs.emacs-overlay.overlay
(self: super: {
steam = self.unstable.steam;
})
# uncomment this to build everything from scratch, fun but takes a
# while
#
# (self: super: {
# stdenv = super.impureUseNativeOptimizations super.stdenv;
# })
] ++ shared_overlays;
}
];
};
};
};
}