configuration.nix/flake.nix

270 lines
8.2 KiB
Nix
Raw Normal View History

2023-03-15 22:11:59 +05:30
{
2024-06-22 19:56:27 +05:30
description = "NixOS Configuration for Skipper";
2023-03-25 22:10:42 +05:30
2024-03-22 23:59:14 +05:30
nixConfig = {
extra-substituters = [
2024-10-27 23:21:39 +05:30
"https://adtya.cachix.org"
2024-04-26 10:17:06 +05:30
"https://nix-community.cachix.org"
"https://cache.nixos.org"
2024-03-22 23:59:14 +05:30
];
extra-trusted-public-keys = [
2024-10-27 23:21:39 +05:30
"adtya.cachix.org-1:lAuNLx0Ehzx6FoH20rVkMD7KyZZevlLfvm3lwMAzrnU="
2024-04-26 10:17:06 +05:30
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
2024-03-22 23:59:14 +05:30
];
};
2023-03-15 22:11:59 +05:30
inputs = {
2024-05-30 23:06:45 +05:30
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
2024-09-14 19:36:06 +05:30
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-04-01 23:20:13 +05:30
home-manager = {
2024-05-30 23:06:45 +05:30
url = "github:nix-community/home-manager?ref=master";
2023-03-15 22:11:59 +05:30
inputs.nixpkgs.follows = "nixpkgs";
};
2024-05-30 23:06:45 +05:30
impermanence.url = "github:nix-community/impermanence?ref=master";
lanzaboote.url = "github:nix-community/lanzaboote?ref=master";
2024-06-16 18:43:46 +05:30
sops-nix.url = "github:Mic92/sops-nix?ref=master";
2024-06-30 23:45:47 +05:30
deploy-rs.url = "github:serokell/deploy-rs?ref=master";
flake-utils.url = "github:numtide/flake-utils?ref=main";
2024-06-10 00:21:36 +05:30
neovim-nightly.url = "github:nix-community/neovim-nightly-overlay?ref=master";
2024-10-30 22:41:44 +05:30
caddy.url = "git+https://forge.acomputer.lol/adtya/caddy-with-modules?ref=main";
adtyaxyz.url = "git+https://forge.acomputer.lol/adtya/adtya.xyz?ref=main";
wiki.url = "git+https://forge.acomputer.lol/adtya/wiki?ref=main";
2023-03-15 22:11:59 +05:30
};
2023-11-04 16:12:45 +05:30
outputs =
{ self
, nixpkgs
2024-09-14 19:36:06 +05:30
, lix-module
2023-11-04 16:12:45 +05:30
, home-manager
, impermanence
, lanzaboote
2024-06-16 18:43:46 +05:30
, sops-nix
2024-06-30 18:19:23 +05:30
, deploy-rs
2024-06-21 10:10:14 +05:30
, flake-utils
2024-06-10 00:21:36 +05:30
, neovim-nightly
2024-09-14 16:07:45 +05:30
, caddy
2024-07-03 17:03:34 +05:30
, adtyaxyz
2024-07-03 22:57:30 +05:30
, wiki
2023-11-04 16:12:45 +05:30
,
} @ inputs:
let
2024-08-10 23:37:32 +05:30
inherit (nixpkgs) lib;
2024-05-18 14:52:39 +05:30
packages = system: import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
overlays = [ (import ./extra-packages) ];
2023-11-04 16:12:45 +05:30
};
in
2023-08-05 14:36:01 +05:30
{
nixosModules.default = import ./modules;
2023-08-05 14:36:01 +05:30
nixosConfigurations = {
2024-06-22 19:56:27 +05:30
Skipper =
let
hostname = "Skipper";
system = "x86_64-linux";
username = "adtya";
in
nixpkgs.lib.nixosSystem {
inherit system;
pkgs = packages system;
specialArgs = { inherit inputs username; };
modules = [
{
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
networking.hostName = lib.mkDefault hostname;
nixpkgs.hostPlatform = lib.mkDefault system;
}
2024-09-14 19:36:06 +05:30
lix-module.nixosModules.default
2024-06-22 19:56:27 +05:30
sops-nix.nixosModules.sops
lanzaboote.nixosModules.lanzaboote
impermanence.nixosModules.impermanence
home-manager.nixosModules.home-manager
2024-07-06 00:54:18 +05:30
self.nixosModules.default
2024-06-22 19:56:27 +05:30
./common
./hosts/skipper
./home
2024-06-25 00:23:05 +05:30
];
};
2024-06-29 17:52:32 +05:30
Rico0 =
let
hostname = "Rico0";
system = "aarch64-linux";
username = "adtya";
in
nixpkgs.lib.nixosSystem {
inherit system;
pkgs = packages system;
specialArgs = { inherit inputs username; };
modules = [
{
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
networking.hostName = lib.mkDefault hostname;
nixpkgs.hostPlatform = lib.mkDefault system;
}
sops-nix.nixosModules.sops
2024-07-05 02:04:14 +05:30
self.nixosModules.default
2024-06-29 17:52:32 +05:30
./common
./hosts/rico0
];
};
2024-06-25 00:23:05 +05:30
Rico1 =
let
hostname = "Rico1";
system = "aarch64-linux";
username = "adtya";
in
nixpkgs.lib.nixosSystem {
inherit system;
pkgs = packages system;
specialArgs = { inherit inputs username; };
modules = [
{
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
networking.hostName = lib.mkDefault hostname;
nixpkgs.hostPlatform = lib.mkDefault system;
}
sops-nix.nixosModules.sops
2024-07-06 00:54:18 +05:30
self.nixosModules.default
2024-06-25 00:23:05 +05:30
./common
./hosts/rico1
2024-06-22 19:56:27 +05:30
];
};
2024-06-29 17:52:32 +05:30
Rico2 =
let
hostname = "Rico2";
system = "aarch64-linux";
username = "adtya";
in
nixpkgs.lib.nixosSystem {
inherit system;
pkgs = packages system;
specialArgs = { inherit inputs username; };
modules = [
{
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
networking.hostName = lib.mkDefault hostname;
nixpkgs.hostPlatform = lib.mkDefault system;
}
sops-nix.nixosModules.sops
2024-07-05 02:29:05 +05:30
self.nixosModules.default
2024-06-29 17:52:32 +05:30
./common
./hosts/rico2
];
};
2024-07-03 17:03:51 +05:30
Wynne =
let
hostname = "Wynne";
system = "x86_64-linux";
username = "adtya";
in
nixpkgs.lib.nixosSystem {
inherit system;
pkgs = packages system;
specialArgs = { inherit inputs username; };
modules = [
{
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
networking.hostName = lib.mkDefault hostname;
nixpkgs.hostPlatform = lib.mkDefault system;
}
sops-nix.nixosModules.sops
2024-07-05 02:29:05 +05:30
self.nixosModules.default
2024-07-03 17:03:51 +05:30
./common
./hosts/wynne
];
};
2024-07-03 19:22:10 +05:30
Layne =
let
hostname = "Layne";
system = "x86_64-linux";
username = "adtya";
in
nixpkgs.lib.nixosSystem {
inherit system;
pkgs = packages system;
specialArgs = { inherit inputs username; };
modules = [
{
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
networking.hostName = lib.mkDefault hostname;
nixpkgs.hostPlatform = lib.mkDefault system;
}
sops-nix.nixosModules.sops
2024-07-05 02:29:05 +05:30
self.nixosModules.default
2024-07-03 19:22:10 +05:30
./common
./hosts/layne
];
};
2023-03-15 22:11:59 +05:30
};
2024-06-30 18:19:23 +05:30
deploy.nodes = {
Rico0 = {
hostname = "Rico0";
sshUser = "adtya";
profiles.system = {
user = "root";
path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.Rico0;
};
};
2024-06-30 21:54:53 +05:30
Rico1 = {
hostname = "Rico1";
sshUser = "adtya";
profiles.system = {
user = "root";
path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.Rico1;
};
};
Rico2 = {
hostname = "Rico2";
sshUser = "adtya";
profiles.system = {
user = "root";
path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.Rico2;
};
};
2024-07-03 20:10:13 +05:30
Wynne = {
hostname = "Wynne";
sshUser = "adtya";
profiles.system = {
user = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.Wynne;
};
};
Layne = {
hostname = "Layne";
sshUser = "adtya";
profiles.system = {
user = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.Layne;
};
};
2024-06-30 18:19:23 +05:30
};
2023-08-05 14:36:01 +05:30
}
2024-01-04 21:51:32 +05:30
// flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
in
2024-05-18 10:24:28 +05:30
{
formatter = pkgs.nixpkgs-fmt;
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
2024-01-04 21:51:32 +05:30
git
statix
2024-06-16 18:43:46 +05:30
sops
age
2024-06-30 18:19:23 +05:30
deploy-rs.packages.${pkgs.system}.default
2024-01-04 21:51:32 +05:30
];
};
2024-06-30 18:19:23 +05:30
packages.getpaper = pkgs.callPackage ./extra-packages/scripts/getpaper { };
2024-01-04 21:51:32 +05:30
}
2023-08-05 14:36:01 +05:30
);
2023-03-15 22:11:59 +05:30
}