2023-11-30 00:49:32 -06:00
|
|
|
{
|
|
|
|
description = "Price Hiller's home manager configuration";
|
|
|
|
|
|
|
|
inputs = {
|
2024-05-03 14:35:00 -05:00
|
|
|
nix.url = "github:nixos/nix";
|
|
|
|
deploy-rs.url = "github:serokell/deploy-rs";
|
2024-04-23 10:36:34 -05:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
2024-09-05 10:57:43 -05:00
|
|
|
nixpkgs-master.url = "github:nixos/nixpkgs";
|
2024-10-28 16:12:41 -05:00
|
|
|
fenix = {
|
|
|
|
url = "github:nix-community/fenix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2024-09-27 00:36:41 -05:00
|
|
|
lanzaboote = {
|
|
|
|
url = "github:nix-community/lanzaboote";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-11-30 00:49:32 -06:00
|
|
|
home-manager = {
|
|
|
|
url = "github:nix-community/home-manager";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2024-11-10 16:08:53 -06:00
|
|
|
hyprland.url = "github:hyprwm/Hyprland";
|
2024-10-19 16:16:38 -05:00
|
|
|
wezterm.url = "github:wez/wezterm?dir=nix";
|
2024-03-14 03:37:02 -05:00
|
|
|
agenix = {
|
|
|
|
url = "github:yaxitech/ragenix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2024-11-01 15:15:09 -05:00
|
|
|
impermanence.url = "github:nix-community/impermanence";
|
2024-05-03 14:35:00 -05:00
|
|
|
disko = {
|
|
|
|
url = "github:nix-community/disko";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
blog = {
|
2024-10-19 16:15:57 -05:00
|
|
|
url = "git+https://git.price-hiller.com/blog/blog";
|
2024-05-03 14:35:00 -05:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2024-07-09 23:26:57 -05:00
|
|
|
emacs-overlay = {
|
|
|
|
url = "github:nix-community/emacs-overlay";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2024-10-31 13:12:01 -05:00
|
|
|
};
|
|
|
|
neovim-src = {
|
|
|
|
url = "github:neovim/neovim";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
neovim-nightly-overlay = {
|
|
|
|
url = "github:nix-community/neovim-nightly-overlay";
|
|
|
|
inputs = {
|
|
|
|
neovim-src.follows = "neovim-src";
|
|
|
|
nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2024-07-09 23:26:57 -05:00
|
|
|
};
|
2024-09-26 23:43:49 -05:00
|
|
|
secrets = {
|
|
|
|
url = "git+file:secrets?submodules=1";
|
|
|
|
flake = false;
|
|
|
|
};
|
2023-11-30 00:49:32 -06:00
|
|
|
};
|
|
|
|
|
2024-04-19 22:27:46 -05:00
|
|
|
outputs =
|
2024-05-03 14:35:00 -05:00
|
|
|
inputs@{ self, nixpkgs, ... }:
|
2023-11-30 00:49:32 -06:00
|
|
|
let
|
2024-05-03 14:35:00 -05:00
|
|
|
inherit (self) outputs;
|
|
|
|
forAllSystems =
|
|
|
|
function:
|
|
|
|
nixpkgs.lib.genAttrs
|
|
|
|
[
|
|
|
|
"aarch64-linux"
|
|
|
|
"i686-linux"
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-darwin"
|
|
|
|
"x86_64-darwin"
|
|
|
|
]
|
|
|
|
(
|
|
|
|
system:
|
|
|
|
function (
|
|
|
|
import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [
|
|
|
|
inputs.agenix.overlays.default
|
2024-05-10 02:41:46 -05:00
|
|
|
self.overlays.modifications
|
|
|
|
self.overlays.additions
|
2024-05-03 14:35:00 -05:00
|
|
|
];
|
|
|
|
}
|
|
|
|
)
|
|
|
|
);
|
|
|
|
in
|
|
|
|
{
|
|
|
|
formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
|
|
|
|
packages = forAllSystems (pkgs: import ./pkgs pkgs);
|
|
|
|
overlays = import ./overlays { inherit inputs; };
|
|
|
|
devShells = forAllSystems (pkgs: {
|
|
|
|
default = pkgs.mkShell {
|
2024-03-14 03:37:02 -05:00
|
|
|
packages = with pkgs; [
|
|
|
|
age
|
2024-05-10 02:41:46 -05:00
|
|
|
agenix
|
2024-03-14 03:37:02 -05:00
|
|
|
age-plugin-yubikey
|
|
|
|
nixos-rebuild
|
2024-05-03 14:35:00 -05:00
|
|
|
nixos-install-tools
|
2024-03-14 03:37:02 -05:00
|
|
|
pkgs.deploy-rs
|
|
|
|
];
|
|
|
|
shellHook = ''
|
|
|
|
export RULES="$PWD/secrets/secrets.nix"
|
|
|
|
'';
|
|
|
|
};
|
2024-05-03 14:35:00 -05:00
|
|
|
});
|
2024-05-10 00:02:07 -05:00
|
|
|
checks = forAllSystems (pkgs: {
|
|
|
|
formatting =
|
|
|
|
pkgs.runCommand "check-fmt"
|
|
|
|
{
|
|
|
|
buildInputs = with pkgs; [
|
2024-06-28 03:22:50 -05:00
|
|
|
fd
|
2024-05-10 00:02:07 -05:00
|
|
|
(import ./pkgs { inherit pkgs; }).Fmt
|
|
|
|
];
|
|
|
|
}
|
|
|
|
''
|
2024-06-28 03:22:50 -05:00
|
|
|
set -eEuo pipefail
|
|
|
|
fd --exec-batch=Fmt
|
2024-05-10 00:02:07 -05:00
|
|
|
touch $out
|
|
|
|
'';
|
|
|
|
});
|
2024-05-03 14:35:00 -05:00
|
|
|
apps = forAllSystems (pkgs: {
|
|
|
|
install-host = {
|
|
|
|
type = "app";
|
|
|
|
program = "${
|
|
|
|
pkgs.writeShellApplication {
|
|
|
|
name = "install-host";
|
|
|
|
runtimeInputs = with pkgs; [
|
|
|
|
openssh
|
|
|
|
coreutils-full
|
|
|
|
git
|
|
|
|
agenix
|
|
|
|
nix
|
|
|
|
];
|
|
|
|
text = (
|
|
|
|
''
|
|
|
|
#!${pkgs.bash}/bin/bash
|
|
|
|
# The below `cd` invocation ensures the installer is running from the toplevel of
|
|
|
|
# the flake and thus has correct paths available.
|
|
|
|
cd "$(git rev-parse --show-toplevel)"
|
|
|
|
''
|
|
|
|
+ builtins.readFile ./scripts/install-host.bash
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}/bin/install-host";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
nixosConfigurations =
|
|
|
|
let
|
2024-08-25 00:28:11 -05:00
|
|
|
clib = (import ./lib { lib = nixpkgs.lib; });
|
2024-05-03 14:35:00 -05:00
|
|
|
in
|
|
|
|
{
|
|
|
|
orion =
|
|
|
|
let
|
|
|
|
hostname = "orion";
|
|
|
|
in
|
|
|
|
nixpkgs.lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
specialArgs = {
|
|
|
|
inherit self;
|
|
|
|
inherit inputs;
|
|
|
|
inherit outputs;
|
|
|
|
inherit hostname;
|
2024-08-25 00:28:11 -05:00
|
|
|
inherit clib;
|
2024-05-03 14:35:00 -05:00
|
|
|
};
|
|
|
|
modules = [
|
2024-08-24 23:38:27 -05:00
|
|
|
./modules/btrfs-rollback.nix
|
2024-12-18 00:37:02 -06:00
|
|
|
inputs.home-manager.nixosModules.home-manager
|
|
|
|
{
|
|
|
|
home-manager = {
|
|
|
|
extraSpecialArgs = {
|
|
|
|
clib = (import ./lib { lib = nixpkgs.lib; });
|
|
|
|
inherit inputs;
|
|
|
|
};
|
|
|
|
useGlobalPkgs = true;
|
|
|
|
useUserPackages = true;
|
|
|
|
users.price = import ./users/price/home.nix;
|
|
|
|
};
|
|
|
|
}
|
2024-09-27 00:36:41 -05:00
|
|
|
inputs.lanzaboote.nixosModules.lanzaboote
|
2024-05-03 14:35:00 -05:00
|
|
|
inputs.impermanence.nixosModules.impermanence
|
|
|
|
inputs.agenix.nixosModules.default
|
|
|
|
inputs.disko.nixosModules.disko
|
2024-11-06 15:53:21 -06:00
|
|
|
{
|
|
|
|
config = {
|
|
|
|
nixpkgs.overlays = [
|
2024-12-18 00:37:02 -06:00
|
|
|
inputs.emacs-overlay.overlays.default
|
|
|
|
inputs.neovim-nightly-overlay.overlays.default
|
|
|
|
inputs.fenix.overlays.default
|
2024-11-06 15:53:21 -06:00
|
|
|
self.overlays.modifications
|
|
|
|
self.overlays.additions
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|
2024-05-03 14:35:00 -05:00
|
|
|
{
|
|
|
|
config =
|
2024-09-26 23:43:49 -05:00
|
|
|
(import "${inputs.secrets}" {
|
2024-05-03 14:35:00 -05:00
|
|
|
agenix = false;
|
2024-08-25 00:28:11 -05:00
|
|
|
inherit clib;
|
2024-05-03 14:35:00 -05:00
|
|
|
}).${hostname};
|
|
|
|
}
|
|
|
|
./hosts/${hostname}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
luna =
|
|
|
|
let
|
|
|
|
hostname = "luna";
|
|
|
|
in
|
|
|
|
nixpkgs.lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
specialArgs = {
|
|
|
|
inherit self;
|
|
|
|
inherit inputs;
|
|
|
|
inherit hostname;
|
|
|
|
inherit nixpkgs;
|
2024-08-25 00:28:11 -05:00
|
|
|
inherit clib;
|
2024-05-03 14:35:00 -05:00
|
|
|
};
|
|
|
|
modules = [
|
2024-08-25 00:26:25 -05:00
|
|
|
./modules/btrfs-rollback.nix
|
2024-05-03 14:35:00 -05:00
|
|
|
inputs.impermanence.nixosModules.impermanence
|
|
|
|
inputs.agenix.nixosModules.default
|
|
|
|
inputs.disko.nixosModules.disko
|
|
|
|
{
|
|
|
|
config =
|
2024-09-26 23:43:49 -05:00
|
|
|
(import "${inputs.secrets}" {
|
2024-05-03 14:35:00 -05:00
|
|
|
agenix = false;
|
2024-08-25 00:28:11 -05:00
|
|
|
inherit clib;
|
2024-05-03 14:35:00 -05:00
|
|
|
}).${hostname};
|
|
|
|
}
|
|
|
|
./hosts/${hostname}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
deploy.nodes =
|
|
|
|
let
|
|
|
|
deploy-rs = inputs.deploy-rs;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
luna = {
|
2024-10-19 16:15:57 -05:00
|
|
|
hostname = "luna.hosts.price-hiller.com";
|
2024-05-03 14:35:00 -05:00
|
|
|
fastConnection = true;
|
|
|
|
profiles.system = {
|
|
|
|
sshUser = "price";
|
|
|
|
user = "root";
|
|
|
|
path = deploy-rs.lib.x86_64-linux.activate.nixos outputs.nixosConfigurations.luna;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-11-30 00:49:32 -06:00
|
|
|
}
|