nix-dotfiles/flake.nix

229 lines
8.3 KiB
Nix
Raw Normal View History

2023-12-23 06:49:01 +01:00
{
2023-12-23 07:39:10 +01:00
description = "NixOS configuration for RAD-Development Servers";
2023-12-23 06:49:01 +01:00
nixConfig = {
trusted-substituters = [ "https://cache.alicehuston.xyz" "https://cache.nixos.org" "https://nix-community.cachix.org" ];
trusted-public-keys = [ "cache.alicehuston.xyz:SJAm8HJVTWUjwcTTLAoi/5E1gUOJ0GWum2suPPv7CUo=%" "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ];
};
2023-12-23 06:49:01 +01:00
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default";
Add autopull service for testing & pre-commit-hooks (#4) * configure programs for photon * sops fix * Add flake-update-service for testing Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add sops config Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * add photon password * Fix user password Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * actually fix user config Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * change password for user dennis * removed user password * fixed yaml secrets * yaml is silly, fix my yamls pls Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * quickfix * Enforce systemdboot on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * reconfigure photon * Fix ZFS config on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix systemd-boot on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * sops update-keys Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix botched merge Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add custom ssh command Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix option name, add package dependency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix option name, add dependency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * ssh-key path to str Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix git command Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Set up nixpkgs.fmt Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Allow autopull to trigger a rebuild Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Revert triggerRebuild on palatine-hill, add clarifying comment Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Attempt pre-commit hooks Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Increase pull frequency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix duplicate flake-utils url Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add fmt hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * add nix-flake-check hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Remove unnecessary flake-utils import by name Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Trying to setup inputs for nix-pre-commit Co-authored-by: Dennis <52411861+DerDennisOP@users.noreply.github.com> * Fixing input with flake inputs Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * make autopull service default and fix flake check hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Remove pre-commit-config.yml from gitignore that decision seems to be something from one of my previous attempts at this. Given that the config is needed for this to work it only makes sense to have it. /.pre-commit-config.yaml /.pre-commit-config.yaml Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Rollback previous commit. yml file is a softlink Signed-off-by: ahuston-0 <aliceghuston@gmail.com> --------- Signed-off-by: ahuston-0 <aliceghuston@gmail.com> Co-authored-by: Dennis Wuitz <dennish@wuitz.de> Co-authored-by: Dennis <52411861+DerDennisOP@users.noreply.github.com>
2024-01-01 12:41:32 -05:00
nix = {
url = "github:NixOS/nix/nixos-unstable";
inputs.nixpkgs.follows = "nixpkgs";
};
Add autopull service for testing & pre-commit-hooks (#4) * configure programs for photon * sops fix * Add flake-update-service for testing Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add sops config Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * add photon password * Fix user password Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * actually fix user config Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * change password for user dennis * removed user password * fixed yaml secrets * yaml is silly, fix my yamls pls Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * quickfix * Enforce systemdboot on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * reconfigure photon * Fix ZFS config on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix systemd-boot on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * sops update-keys Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix botched merge Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add custom ssh command Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix option name, add package dependency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix option name, add dependency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * ssh-key path to str Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix git command Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Set up nixpkgs.fmt Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Allow autopull to trigger a rebuild Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Revert triggerRebuild on palatine-hill, add clarifying comment Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Attempt pre-commit hooks Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Increase pull frequency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix duplicate flake-utils url Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add fmt hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * add nix-flake-check hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Remove unnecessary flake-utils import by name Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Trying to setup inputs for nix-pre-commit Co-authored-by: Dennis <52411861+DerDennisOP@users.noreply.github.com> * Fixing input with flake inputs Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * make autopull service default and fix flake check hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Remove pre-commit-config.yml from gitignore that decision seems to be something from one of my previous attempts at this. Given that the config is needed for this to work it only makes sense to have it. /.pre-commit-config.yaml /.pre-commit-config.yaml Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Rollback previous commit. yml file is a softlink Signed-off-by: ahuston-0 <aliceghuston@gmail.com> --------- Signed-off-by: ahuston-0 <aliceghuston@gmail.com> Co-authored-by: Dennis Wuitz <dennish@wuitz.de> Co-authored-by: Dennis <52411861+DerDennisOP@users.noreply.github.com>
2024-01-01 12:41:32 -05:00
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
2024-02-02 05:20:43 +01:00
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs-fmt = {
url = "github:rad-development/nixpkgs-fmt";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
fenix.follows = "fenix";
};
};
2023-12-24 18:48:52 +01:00
nixos-modules = {
url = "github:SuperSandro2000/nixos-modules";
2024-01-08 16:24:53 +01:00
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
2023-12-24 18:48:52 +01:00
};
mailserver = {
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
inputs = {
nixpkgs.follows = "nixpkgs";
nixpkgs-23_05.follows = "nixpkgs";
2024-01-26 23:13:06 +01:00
nixpkgs-23_11.follows = "nixpkgs";
utils.follows = "flake-utils";
};
};
2023-12-25 03:39:20 +01:00
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-12-23 06:49:01 +01:00
sops-nix = {
url = "github:Mic92/sops-nix";
2023-12-24 18:48:52 +01:00
inputs = {
nixpkgs.follows = "nixpkgs";
nixpkgs-stable.follows = "nixpkgs";
};
2023-12-23 06:49:01 +01:00
};
Add autopull service for testing & pre-commit-hooks (#4) * configure programs for photon * sops fix * Add flake-update-service for testing Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add sops config Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * add photon password * Fix user password Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * actually fix user config Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * change password for user dennis * removed user password * fixed yaml secrets * yaml is silly, fix my yamls pls Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * quickfix * Enforce systemdboot on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * reconfigure photon * Fix ZFS config on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix systemd-boot on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * sops update-keys Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix botched merge Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add custom ssh command Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix option name, add package dependency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix option name, add dependency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * ssh-key path to str Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix git command Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Set up nixpkgs.fmt Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Allow autopull to trigger a rebuild Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Revert triggerRebuild on palatine-hill, add clarifying comment Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Attempt pre-commit hooks Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Increase pull frequency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix duplicate flake-utils url Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add fmt hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * add nix-flake-check hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Remove unnecessary flake-utils import by name Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Trying to setup inputs for nix-pre-commit Co-authored-by: Dennis <52411861+DerDennisOP@users.noreply.github.com> * Fixing input with flake inputs Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * make autopull service default and fix flake check hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Remove pre-commit-config.yml from gitignore that decision seems to be something from one of my previous attempts at this. Given that the config is needed for this to work it only makes sense to have it. /.pre-commit-config.yaml /.pre-commit-config.yaml Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Rollback previous commit. yml file is a softlink Signed-off-by: ahuston-0 <aliceghuston@gmail.com> --------- Signed-off-by: ahuston-0 <aliceghuston@gmail.com> Co-authored-by: Dennis Wuitz <dennish@wuitz.de> Co-authored-by: Dennis <52411861+DerDennisOP@users.noreply.github.com>
2024-01-01 12:41:32 -05:00
nix-pre-commit = {
url = "github:jmgilman/nix-pre-commit";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
2023-12-23 06:49:01 +01:00
};
outputs = { self, nixpkgs-fmt, nix, home-manager, mailserver, nix-pre-commit, nixos-modules, nixpkgs, sops-nix, ... }:
2023-12-27 10:03:13 +01:00
let
inherit (nixpkgs) lib;
systems = [ "x86_64-linux" "aarch64-linux" ];
forEachSystem = lib.genAttrs systems;
overlayList = [ self.overlays.default nix.overlays.default ];
pkgsBySystem = forEachSystem (system: import nixpkgs {
inherit system;
overlays = overlayList;
});
2023-12-27 10:03:13 +01:00
src = builtins.filterSource (path: type: type == "directory" || lib.hasSuffix ".nix" (baseNameOf path)) ./.;
ls = dir: lib.attrNames (builtins.readDir (src + "/${dir}"));
2024-01-27 16:05:35 +01:00
lsdir = dir: if (builtins.pathExists (src + "/${dir}")) then (lib.attrNames (lib.filterAttrs (path: type: type == "directory") (builtins.readDir (src + "/${dir}")))) else [ ];
2023-12-27 10:03:13 +01:00
fileList = dir: map (file: ./. + "/${dir}/${file}") (ls dir);
Add autopull service for testing & pre-commit-hooks (#4) * configure programs for photon * sops fix * Add flake-update-service for testing Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add sops config Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * add photon password * Fix user password Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * actually fix user config Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * change password for user dennis * removed user password * fixed yaml secrets * yaml is silly, fix my yamls pls Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * quickfix * Enforce systemdboot on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * reconfigure photon * Fix ZFS config on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix systemd-boot on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * sops update-keys Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix botched merge Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add custom ssh command Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix option name, add package dependency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix option name, add dependency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * ssh-key path to str Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix git command Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Set up nixpkgs.fmt Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Allow autopull to trigger a rebuild Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Revert triggerRebuild on palatine-hill, add clarifying comment Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Attempt pre-commit hooks Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Increase pull frequency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix duplicate flake-utils url Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add fmt hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * add nix-flake-check hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Remove unnecessary flake-utils import by name Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Trying to setup inputs for nix-pre-commit Co-authored-by: Dennis <52411861+DerDennisOP@users.noreply.github.com> * Fixing input with flake inputs Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * make autopull service default and fix flake check hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Remove pre-commit-config.yml from gitignore that decision seems to be something from one of my previous attempts at this. Given that the config is needed for this to work it only makes sense to have it. /.pre-commit-config.yaml /.pre-commit-config.yaml Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Rollback previous commit. yml file is a softlink Signed-off-by: ahuston-0 <aliceghuston@gmail.com> --------- Signed-off-by: ahuston-0 <aliceghuston@gmail.com> Co-authored-by: Dennis Wuitz <dennish@wuitz.de> Co-authored-by: Dennis <52411861+DerDennisOP@users.noreply.github.com>
2024-01-01 12:41:32 -05:00
recursiveMerge = attrList:
let
f = attrPath:
builtins.zipAttrsWith (n: values:
if builtins.tail values == [ ] then
builtins.head values
else if builtins.all builtins.isList values then
builtins.unique (builtins.concatLists values)
else if builtins.all builtins.isAttrs values then
f (attrPath ++ [ n ]) values
else
lib.last values);
in
f [ ] attrList;
Add autopull service for testing & pre-commit-hooks (#4) * configure programs for photon * sops fix * Add flake-update-service for testing Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add sops config Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * add photon password * Fix user password Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * actually fix user config Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * change password for user dennis * removed user password * fixed yaml secrets * yaml is silly, fix my yamls pls Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * quickfix * Enforce systemdboot on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * reconfigure photon * Fix ZFS config on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix systemd-boot on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * sops update-keys Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix botched merge Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add custom ssh command Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix option name, add package dependency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix option name, add dependency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * ssh-key path to str Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix git command Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Set up nixpkgs.fmt Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Allow autopull to trigger a rebuild Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Revert triggerRebuild on palatine-hill, add clarifying comment Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Attempt pre-commit hooks Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Increase pull frequency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix duplicate flake-utils url Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add fmt hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * add nix-flake-check hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Remove unnecessary flake-utils import by name Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Trying to setup inputs for nix-pre-commit Co-authored-by: Dennis <52411861+DerDennisOP@users.noreply.github.com> * Fixing input with flake inputs Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * make autopull service default and fix flake check hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Remove pre-commit-config.yml from gitignore that decision seems to be something from one of my previous attempts at this. Given that the config is needed for this to work it only makes sense to have it. /.pre-commit-config.yaml /.pre-commit-config.yaml Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Rollback previous commit. yml file is a softlink Signed-off-by: ahuston-0 <aliceghuston@gmail.com> --------- Signed-off-by: ahuston-0 <aliceghuston@gmail.com> Co-authored-by: Dennis Wuitz <dennish@wuitz.de> Co-authored-by: Dennis <52411861+DerDennisOP@users.noreply.github.com>
2024-01-01 12:41:32 -05:00
config = {
repos = [
{
repo = "https://gitlab.com/vojko.pribudic/pre-commit-update";
2024-02-01 05:24:04 +01:00
rev = "bbd69145df8741f4f470b8f1cf2867121be52121";
hooks = [{
id = "pre-commit-update";
args = [ "--dry-run" ];
}];
}
Add autopull service for testing & pre-commit-hooks (#4) * configure programs for photon * sops fix * Add flake-update-service for testing Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add sops config Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * add photon password * Fix user password Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * actually fix user config Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * change password for user dennis * removed user password * fixed yaml secrets * yaml is silly, fix my yamls pls Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * quickfix * Enforce systemdboot on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * reconfigure photon * Fix ZFS config on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix systemd-boot on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * sops update-keys Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix botched merge Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add custom ssh command Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix option name, add package dependency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix option name, add dependency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * ssh-key path to str Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix git command Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Set up nixpkgs.fmt Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Allow autopull to trigger a rebuild Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Revert triggerRebuild on palatine-hill, add clarifying comment Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Attempt pre-commit hooks Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Increase pull frequency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix duplicate flake-utils url Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add fmt hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * add nix-flake-check hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Remove unnecessary flake-utils import by name Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Trying to setup inputs for nix-pre-commit Co-authored-by: Dennis <52411861+DerDennisOP@users.noreply.github.com> * Fixing input with flake inputs Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * make autopull service default and fix flake check hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Remove pre-commit-config.yml from gitignore that decision seems to be something from one of my previous attempts at this. Given that the config is needed for this to work it only makes sense to have it. /.pre-commit-config.yaml /.pre-commit-config.yaml Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Rollback previous commit. yml file is a softlink Signed-off-by: ahuston-0 <aliceghuston@gmail.com> --------- Signed-off-by: ahuston-0 <aliceghuston@gmail.com> Co-authored-by: Dennis Wuitz <dennish@wuitz.de> Co-authored-by: Dennis <52411861+DerDennisOP@users.noreply.github.com>
2024-01-01 12:41:32 -05:00
{
repo = "local";
hooks = [
{
id = "nixfmt check";
entry = "${nixpkgs-fmt.legacyPackages.x86_64-linux.nixpkgs-fmt}/bin/nixpkgs-fmt";
args = [ "--check" ];
Add autopull service for testing & pre-commit-hooks (#4) * configure programs for photon * sops fix * Add flake-update-service for testing Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add sops config Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * add photon password * Fix user password Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * actually fix user config Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * change password for user dennis * removed user password * fixed yaml secrets * yaml is silly, fix my yamls pls Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * quickfix * Enforce systemdboot on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * reconfigure photon * Fix ZFS config on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix systemd-boot on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * sops update-keys Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix botched merge Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add custom ssh command Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix option name, add package dependency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix option name, add dependency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * ssh-key path to str Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix git command Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Set up nixpkgs.fmt Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Allow autopull to trigger a rebuild Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Revert triggerRebuild on palatine-hill, add clarifying comment Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Attempt pre-commit hooks Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Increase pull frequency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix duplicate flake-utils url Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add fmt hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * add nix-flake-check hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Remove unnecessary flake-utils import by name Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Trying to setup inputs for nix-pre-commit Co-authored-by: Dennis <52411861+DerDennisOP@users.noreply.github.com> * Fixing input with flake inputs Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * make autopull service default and fix flake check hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Remove pre-commit-config.yml from gitignore that decision seems to be something from one of my previous attempts at this. Given that the config is needed for this to work it only makes sense to have it. /.pre-commit-config.yaml /.pre-commit-config.yaml Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Rollback previous commit. yml file is a softlink Signed-off-by: ahuston-0 <aliceghuston@gmail.com> --------- Signed-off-by: ahuston-0 <aliceghuston@gmail.com> Co-authored-by: Dennis Wuitz <dennish@wuitz.de> Co-authored-by: Dennis <52411861+DerDennisOP@users.noreply.github.com>
2024-01-01 12:41:32 -05:00
language = "system";
files = "\\.nix";
}
{
id = "nix-flake-check";
entry = "nix flake check";
language = "system";
files = "\\.nix";
pass_filenames = false;
}
];
}
];
};
2023-12-27 10:03:13 +01:00
in
{
formatter = forEachSystem (system: nixpkgs-fmt.legacyPackages.${system}.nixpkgs-fmt);
overlays.default = final: prev: {
nixpkgs-fmt = forEachSystem (system: nixpkgs-fmt.legacyPackages.${system}.nixpkgs.fmt);
};
2023-12-27 10:03:13 +01:00
nixosConfigurations =
let
constructSystem = { hostname, users, home ? true, modules ? [ ], server ? true, sops ? true, system ? "x86_64-linux" }:
lib.nixosSystem {
2024-01-26 23:13:06 +01:00
inherit system;
Add autopull service for testing & pre-commit-hooks (#4) * configure programs for photon * sops fix * Add flake-update-service for testing Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add sops config Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * add photon password * Fix user password Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * actually fix user config Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * change password for user dennis * removed user password * fixed yaml secrets * yaml is silly, fix my yamls pls Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * quickfix * Enforce systemdboot on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * reconfigure photon * Fix ZFS config on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix systemd-boot on palatine-hill Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * sops update-keys Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix botched merge Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add custom ssh command Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix option name, add package dependency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix option name, add dependency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * ssh-key path to str Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix git command Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Set up nixpkgs.fmt Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Allow autopull to trigger a rebuild Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Revert triggerRebuild on palatine-hill, add clarifying comment Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Attempt pre-commit hooks Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Increase pull frequency Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Fix duplicate flake-utils url Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Add fmt hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * add nix-flake-check hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Remove unnecessary flake-utils import by name Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Trying to setup inputs for nix-pre-commit Co-authored-by: Dennis <52411861+DerDennisOP@users.noreply.github.com> * Fixing input with flake inputs Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * make autopull service default and fix flake check hook Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Remove pre-commit-config.yml from gitignore that decision seems to be something from one of my previous attempts at this. Given that the config is needed for this to work it only makes sense to have it. /.pre-commit-config.yaml /.pre-commit-config.yaml Signed-off-by: ahuston-0 <aliceghuston@gmail.com> * Rollback previous commit. yml file is a softlink Signed-off-by: ahuston-0 <aliceghuston@gmail.com> --------- Signed-off-by: ahuston-0 <aliceghuston@gmail.com> Co-authored-by: Dennis Wuitz <dennish@wuitz.de> Co-authored-by: Dennis <52411861+DerDennisOP@users.noreply.github.com>
2024-01-01 12:41:32 -05:00
modules = [ nixos-modules.nixosModule sops-nix.nixosModules.sops { config.networking.hostName = "${hostname}"; } ] ++ (if server then [
mailserver.nixosModules.mailserver
2023-12-27 10:03:13 +01:00
./systems/programs.nix
./systems/configuration.nix
./systems/${hostname}/hardware.nix
./systems/${hostname}/configuration.nix
] else [
./users/${builtins.head users}/systems/${hostname}/configuration.nix
./users/${builtins.head users}/systems/${hostname}/hardware.nix
]) ++ fileList "modules" ++ modules ++ lib.optional home home-manager.nixosModules.home-manager
++ (if home then (map (user: { home-manager.users.${user} = import ./users/${user}/home.nix; }) users) else [ ]) ++ map
(user:
{ config, lib, pkgs, ... }@args: {
users.users.${user} = import ./users/${user} (args // { name = "${user}"; });
boot.initrd.network.ssh.authorizedKeys = lib.mkIf server config.users.users.${user}.openssh.authorizedKeys.keys;
sops = lib.mkIf sops {
secrets."${user}/user-password" = {
sopsFile = ./users/${user}/secrets.yaml;
neededForUsers = true;
};
2023-12-27 10:03:13 +01:00
};
})
users;
2023-12-26 19:06:02 +01:00
};
2023-12-27 10:03:13 +01:00
in
2024-01-30 18:37:13 +01:00
(builtins.listToAttrs (map
(system: {
name = system;
value = constructSystem ({ hostname = system; } // builtins.removeAttrs (import ./systems/${system} { }) [ "hostname" "server" "home" ]);
2024-01-30 18:37:13 +01:00
})
(lsdir "systems"))) // (builtins.listToAttrs (builtins.concatMap
(user:
map
(system: {
name = "${user}.${system}";
value = constructSystem ({
hostname = system;
server = false;
users = [ user ];
} // builtins.removeAttrs (import ./users/${user}/systems/${system} { }) [ "hostname" "server" "users" ]);
})
(lsdir "users/${user}/systems"))
2024-01-27 16:05:35 +01:00
(lsdir "users")));
2024-01-26 23:13:06 +01:00
2023-12-27 10:03:13 +01:00
devShell = lib.mapAttrs
(system: sopsPkgs:
with nixpkgs.legacyPackages.${system};
mkShell {
sopsPGPKeyDirs = [ "./keys" ];
nativeBuildInputs = [ apacheHttpd sopsPkgs.sops-import-keys-hook ];
packages = [ self.formatter.${system} ];
shellHook = (nix-pre-commit.lib.${system}.mkConfig { inherit pkgs config; }).shellHook;
})
2023-12-27 10:03:13 +01:00
sops-nix.packages;
hydraJobs = {
build = (recursiveMerge
(
(map
(machine: {
${machine.pkgs.system} = (builtins.listToAttrs (builtins.filter (v: v != { }) (map
(pkg: (if (builtins.hasAttr pkg.name pkgsBySystem.${machine.pkgs.system}) then {
name = pkg.name;
value = pkgsBySystem.${machine.pkgs.system}.${pkg.name};
} else { }))
machine.config.environment.systemPackages)));
})
(builtins.attrValues self.nixosConfigurations)) ++ [
(forEachSystem (system: {
${system}.${nixpkgs-fmt.legacyPackages.${system}.nixpkgs-fmt.name} = pkgsBySystem.${system}.${nixpkgs-fmt.legacyPackages.${system}.nixpkgs-fmt.name};
}))
]
));
};
2023-12-27 10:03:13 +01:00
};
2023-12-23 06:49:01 +01:00
}