nixos-dotfiles/flake.nix

105 lines
2.7 KiB
Nix

{
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix.url = "github:ryantm/agenix";
sensitives = {
url = "path:/etc/nixos/sensitives";
flake = false;
};
nur = {
url = "github:nix-community/NUR";
inputs.nixpkgs.follows = "nixpkgs";
};
openconnect-sso = {
url = "github:ThinkChaos/openconnect-sso/fix/nix-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{ nixpkgs, unstable, home-manager, agenix, sensitives, nur, openconnect-sso, ... }:
let
system = "x86_64-linux";
in
{
nixosConfigurations =
let
# Inject unstable for inputs for modules
defaults = { pkgs, ... }: {
_module.args = {
inherit sensitives;
unstable = import inputs.unstable {
inherit (pkgs.stdenv.targetPlatform) system;
config.allowUnfree = true;
};
};
};
in {
artemis = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
({ config, lib, sensitives, ... }:
{
config.wireguard.lab.remote = lib.fileContents "${sensitives}/homeip";
})
{
environment.systemPackages = [
inputs.openconnect-sso.packages.x86_64-linux.default
];
nixpkgs.overlays = [
# add nur overlay for Firefox addons
nur.overlay
# (import "${builtins.fetchTarball https://github.com/vlaci/openconnect-sso/archive/master.tar.gz}/overlay.nix")
];
}
defaults
home-manager.nixosModules.home-manager
agenix.nixosModules.default
{
networking.hostName = "artemis";
networking.networkmanager.enable = true;
environment.systemPackages = [ agenix.packages.x86_64-linux.default ];
}
./common.nix
./hosts/artemis
];
};
xps15 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
defaults
home-manager.nixosModules.home-manager
agenix.nixosModules.default
{
networking.hostName = "xps15";
}
./common.nix
./hosts/xps15.nix
];
};
};
};
}