dotfiles/nixos/flake.nix

144 lines
4.1 KiB
Nix
Raw Normal View History

{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-20.09";
nixpkgs-unstable.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
2021-01-18 20:24:07 +01:00
nixpkgs-master.url = "github:NixOS/nixpkgs?ref=master";
ra-systems = {
url = "git+https://gitea.redalder.org/RedAlder/systems";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager?ref=release-20.09";
inputs.nixpkgs.follows = "nixpkgs";
};
2021-01-18 11:23:15 +01:00
2021-01-18 20:24:07 +01:00
# PACKAGES
## sss-cli
2021-01-18 11:23:15 +01:00
sss-cli = {
flake = false;
url = "github:dsprenkels/sss-cli";
};
2021-01-18 20:24:07 +01:00
## Emacs
emacs-overlay = {
url = "git+https://github.com/nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
emacs = {
type = "git";
url = "https://git.savannah.gnu.org/git/emacs.git";
ref = "feature/native-comp";
flake = false;
};
vtermModule = {
url = "git+https://github.com/akermu/emacs-libvterm";
flake = false;
};
};
2020-12-29 17:58:07 +01:00
outputs = { self, nixpkgs, ... }@inputs:
2021-01-18 20:24:07 +01:00
with inputs; let
customModules = [
ra-systems.flakes.klippy.nixosModules.klippy
ra-systems.flakes.moonraker.nixosModules.moonraker
ra-systems.flakes.mainsail.nixosModules.mainsail
inputs.home-manager.nixosModules.home-manager
];
rlib = (import ./lib.nix inputs { lib = nixpkgs.lib; system = "x86_64-linux"; });
rpkgs = (rlib.getLegacyPkgs
{
allowUnfree = true;
}
{
inherit (inputs) nixpkgs nixpkgs-unstable nixpkgs-master;
}) // {
custom = {
sss-cli = rlib.halfCallFlakePackage ./packages/sss-cli;
atom-shell = rlib.halfCallFlakePackage ./packages/atom-shell;
emacs = rlib.halfCallFlakePackage ./packages/emacs;
emacsclient-remote = rlib.halfCallFlakePackage ./packages/emacsclient-remote;
enter-env = rlib.halfCallFlakePackage ./packages/enter-env;
screenshot = rlib.halfCallFlakePackage ./packages/screenshot;
};
inherit rlib;
};
2020-12-29 17:58:07 +01:00
in {
nixosConfigurations.omen = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
2021-01-18 20:24:07 +01:00
modules = rlib.callModules rpkgs [
./hardware/omen.nix
./modules/pin-nixpkgs.nix
./users/main.nix
] ++ [
2021-01-18 11:23:15 +01:00
({ pkgs, ... }: {
2020-12-29 17:58:07 +01:00
networking = {
hostName = "omen";
useDHCP = false;
interfaces.eno1.useDHCP = true;
};
time.timeZone = "Europe/Bratislava";
system.stateVersion = "20.09";
})
2020-12-29 17:58:07 +01:00
(import ./profiles/laptop.nix {
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
2021-01-18 20:24:07 +01:00
} inputs rpkgs)
] ++ customModules;
2020-12-29 17:58:07 +01:00
};
2020-12-29 17:58:07 +01:00
nixosConfigurations.heater = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
2021-01-18 20:24:07 +01:00
modules = rlib.callModules rpkgs [
./hardware/heater.nix
./profiles/workstation.nix
./modules/pin-nixpkgs.nix
./users/main.nix
] ++ [
2021-01-18 11:23:15 +01:00
({ pkgs, ... }: {
2020-12-29 17:58:07 +01:00
networking = {
hostName = "heater";
useDHCP = false;
interfaces.enp3s0.useDHCP = true;
};
time.timeZone = "Europe/Bratislava";
system.stateVersion = "20.09";
2021-01-10 20:05:04 +01:00
virtualisation.docker.enable = true;
2020-12-29 17:58:07 +01:00
2021-01-18 20:24:07 +01:00
home-manager.users.main = rlib.callModule rpkgs ./hm-profiles/common.nix;
})
] ++ customModules;
2020-12-29 17:58:07 +01:00
};
2021-01-18 11:23:42 +01:00
nixosConfigurations.mark = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
2021-01-18 20:24:07 +01:00
modules = rlib.callModules rpkgs [
./hardware/mark.nix
] ++ [
2021-01-18 11:23:42 +01:00
({ pkgs, ... }: {
time.timeZone = "Europe/Bratislava";
environment.systemPackages = [
pkgs.gnupg
(let
lib = import ./lib.nix
inputs
{ lib = inputs.nixpkgs.lib; system = "x86_64-linux"; };
in
lib.halfCallFlake ./packages/sss-cli)
];
system.stateVersion = "20.09";
})
];
};
};
}