2023-07-30 16:18:49 +00:00
|
|
|
# reference: https://github.com/kenranunderscore/dotfiles/blob/main/flake.nix
|
|
|
|
# also good: https://github.com/cab404/home
|
|
|
|
|
|
|
|
{
|
|
|
|
inputs = {
|
2023-09-30 22:07:32 +00:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs";
|
2024-11-23 21:25:31 +00:00
|
|
|
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.11";
|
2024-09-08 23:38:16 +00:00
|
|
|
#home-manager.url = "github:nix-community/home-manager/release-24.05";
|
|
|
|
home-manager.url = "github:nix-community/home-manager";
|
2023-07-30 16:18:49 +00:00
|
|
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
2023-09-30 22:07:32 +00:00
|
|
|
emacs-overlay.url = "github:nix-community/emacs-overlay";
|
2023-07-30 16:18:49 +00:00
|
|
|
emacs-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
2023-08-14 21:50:06 +00:00
|
|
|
emacs-overlay.inputs.nixpkgs-stable.follows = "nixpkgs-stable";
|
2023-09-30 22:07:32 +00:00
|
|
|
sops-nix.url = "github:Mic92/sops-nix";
|
2023-07-30 16:18:49 +00:00
|
|
|
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
|
2023-08-14 21:50:06 +00:00
|
|
|
sops-nix.inputs.nixpkgs-stable.follows = "nixpkgs-stable";
|
2023-09-30 22:07:32 +00:00
|
|
|
q-sh.url = "sourcehut:~knazarov/q.sh";
|
2023-07-30 16:18:49 +00:00
|
|
|
q-sh.inputs.nixpkgs.follows = "nixpkgs";
|
2024-11-23 09:51:10 +00:00
|
|
|
notes-sh.url = "sourcehut:~knazarov/notes2.sh";
|
2023-09-30 22:07:32 +00:00
|
|
|
notes-sh.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
knazarovcom.url = "sourcehut:~knazarov/knazarov.com";
|
2023-07-30 16:18:49 +00:00
|
|
|
knazarovcom.inputs.nixpkgs.follows = "nixpkgs";
|
2023-09-30 22:07:32 +00:00
|
|
|
vmatveevacom.url = "github:valeriya-matveeva/vmatveeva.com";
|
2023-07-30 16:18:49 +00:00
|
|
|
vmatveevacom.inputs.nixpkgs.follows = "nixpkgs";
|
2023-09-30 22:07:32 +00:00
|
|
|
git-plan.url = "sourcehut:~knazarov/git-plan";
|
2023-08-14 21:50:06 +00:00
|
|
|
git-plan.inputs.nixpkgs.follows = "nixpkgs";
|
2023-09-30 22:07:32 +00:00
|
|
|
};
|
2023-07-30 16:18:49 +00:00
|
|
|
|
2023-09-30 22:07:32 +00:00
|
|
|
outputs = { self, nixpkgs, nixpkgs-stable, home-manager, emacs-overlay
|
|
|
|
, sops-nix, q-sh, notes-sh, knazarovcom, vmatveevacom, git-plan, ...
|
|
|
|
}@attrs:
|
2023-07-30 16:18:49 +00:00
|
|
|
let
|
|
|
|
system = "x86_64-linux";
|
|
|
|
|
2023-09-30 22:07:32 +00:00
|
|
|
specialArgs = { inherit attrs; };
|
2023-07-30 16:18:49 +00:00
|
|
|
buildConfig = modules: system: { inherit modules system specialArgs; };
|
2023-09-30 22:07:32 +00:00
|
|
|
buildSystem = modules: system:
|
|
|
|
nixpkgs.lib.nixosSystem (buildConfig modules system);
|
|
|
|
buildSystemStable = modules: system:
|
|
|
|
nixpkgs-stable.lib.nixosSystem (buildConfig modules system);
|
2023-09-09 21:17:02 +00:00
|
|
|
|
2023-07-30 16:18:49 +00:00
|
|
|
hostAttrs = dir: {
|
|
|
|
settings = import "${dir}/host-metadata.nix";
|
2024-11-23 23:27:47 +00:00
|
|
|
#config = import "${dir}/configuration.nix";
|
2023-07-30 16:18:49 +00:00
|
|
|
};
|
|
|
|
|
2023-09-30 22:07:32 +00:00
|
|
|
node = dir:
|
|
|
|
with hostAttrs dir;
|
2024-09-08 23:38:16 +00:00
|
|
|
buildSystem [
|
2023-09-30 22:07:32 +00:00
|
|
|
({ config, pkgs, ... }: {
|
|
|
|
nixpkgs.overlays = [
|
|
|
|
emacs-overlay.overlay
|
|
|
|
q-sh.overlays.default
|
|
|
|
notes-sh.overlays.default
|
|
|
|
git-plan.overlays.default
|
|
|
|
];
|
|
|
|
})
|
|
|
|
sops-nix.nixosModules.sops
|
|
|
|
home-manager.nixosModule
|
2024-11-23 23:27:47 +00:00
|
|
|
dir
|
2023-09-30 22:07:32 +00:00
|
|
|
] settings.system;
|
2023-07-30 16:18:49 +00:00
|
|
|
|
2023-09-30 22:07:32 +00:00
|
|
|
server = dir:
|
|
|
|
with hostAttrs dir;
|
|
|
|
buildSystem [
|
|
|
|
({ config, pkgs, ... }: {
|
|
|
|
nixpkgs.overlays = [
|
|
|
|
emacs-overlay.overlay
|
|
|
|
q-sh.overlays.default
|
|
|
|
knazarovcom.overlays.default
|
|
|
|
vmatveevacom.overlays.default
|
|
|
|
];
|
|
|
|
})
|
|
|
|
sops-nix.nixosModules.sops
|
|
|
|
home-manager.nixosModule
|
2024-11-23 23:27:47 +00:00
|
|
|
dir
|
2023-09-30 22:07:32 +00:00
|
|
|
] settings.system;
|
|
|
|
in {
|
|
|
|
nixosConfigurations = {
|
|
|
|
mira = node ./nodes/mira;
|
|
|
|
framework = node ./nodes/framework;
|
|
|
|
knazarovcom = server ./nodes/knazarovcom;
|
2023-10-25 23:31:53 +00:00
|
|
|
videos = server ./nodes/videos;
|
2023-07-30 16:18:49 +00:00
|
|
|
};
|
2023-09-30 22:07:32 +00:00
|
|
|
};
|
2023-07-30 16:18:49 +00:00
|
|
|
}
|