passing all tests for all systems

This commit is contained in:
Anish Lakhwara 2022-12-07 02:01:17 +10:00
parent 07b611690e
commit 4f2bb9479e
18 changed files with 142 additions and 97 deletions

155
flake.nix
View file

@ -16,11 +16,16 @@
agenix.inputs.nixpkgs.follows = "nixpkgs"; agenix.inputs.nixpkgs.follows = "nixpkgs";
deploy-rs.url = "github:serokell/deploy-rs"; deploy-rs.url = "github:serokell/deploy-rs";
deploy-rs.inputs.nixpkgs.follows = "nixpkgs"; deploy-rs.inputs.nixpkgs.follows = "nixpkgs";
# Packages # Packages
poonam.url = "git+ssh://gitea@git.sealight.xyz/aynish/kitaab?ref=main"; poonam.url = "git+ssh://gitea@git.sealight.xyz/aynish/kitaab?ref=main";
basant.url = "git+ssh://gitea@git.sealight.xyz/aynish/basant?ref=main"; basant.url = "git+ssh://gitea@git.sealight.xyz/aynish/basant?ref=main";
basant.inputs.nixpkgs.follows = "nixpkgs"; basant.inputs.nixpkgs.follows = "nixpkgs";
basant.inputs.poonam.follows = "poonam"; basant.inputs.poonam.follows = "poonam";
grasp.url = "git+ssh://gitea@git.sealight.xyz/aynish/grasp.git?ref=main";
grasp.inputs.nixpkgs.follows = "nixpkgs";
# Others
nur.url = "github:nix-community/NUR";
rust-overlay = { rust-overlay = {
url = "github:oxalica/rust-overlay"; url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -30,13 +35,10 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.rust-overlay.follows = "rust-overlay"; inputs.rust-overlay.follows = "rust-overlay";
}; };
nur.url = "github:nix-community/NUR";
grasp.url = "git+ssh://gitea@git.sealight.xyz/aynish/grasp.git?ref=main";
grasp.inputs.nixpkgs.follows = "nixpkgs";
tidalcycles.url = "github:mitchmindtree/tidalcycles.nix"; tidalcycles.url = "github:mitchmindtree/tidalcycles.nix";
tidalcycles.inputs.nixpkgs.follows = "unstable"; tidalcycles.inputs.nixpkgs.follows = "unstable";
# TODO hundred rabbits software # TODO hundred rabbits software
# TODO not quite useful yet, since it needs secrets # TODO needs secrets
# dhyan.url = "git+ssh://gitea@git.sealight.xyz/aynish/dhyan?ref=main"; # dhyan.url = "git+ssh://gitea@git.sealight.xyz/aynish/dhyan?ref=main";
# dhyan.inputs.nixpkgs.follows = "nixpkgs"; # dhyan.inputs.nixpkgs.follows = "nixpkgs";
# TODO needs secrets # TODO needs secrets
@ -131,54 +133,78 @@
} }
]; ];
}; };
# helix = pkgs.lib.nixosSystem { helix = nixpkgs.lib.nixosSystem rec {
# specialArgs = { inherit inputs outputs; }; specialArgs = { inherit inputs self; };
# modules = [ system = "x86_64-linux";
# ./hosts/helix pkgs = nixpkgsFor.${system};
# home-manager.nixosModules.home-manager modules = [
# { ./hosts/helix
# home-manager.useGlobalPkgs = true; agenix.nixosModules.age
# home-manager.useUserPackages = true; self.nixosModules.backup
# home-manager.users.anish = import ./home/core; self.nixosModules.hesienbridge
# } home-manager.nixosModules.home-manager
# ]; {
# }; home-manager.useGlobalPkgs = true;
# lituus = pkgs.lib.nixosSystem { home-manager.useUserPackages = true;
# specialArgs = { inherit inputs outputs; }; home-manager.users.anish = import ./home/core;
# modules = [ }
# ./hosts/lituus ];
# home-manager.nixosModules.home-manager };
# { lituus = nixpkgs.lib.nixosSystem rec {
# home-manager.useGlobalPkgs = true; specialArgs = { inherit inputs self; };
# home-manager.useUserPackages = true; system = "x86_64-linux";
# home-manager.users.anish = import ./home/core; pkgs = nixpkgsFor.${system};
# } modules = [
# ]; ./hosts/lituus
# }; agenix.nixosModules.age
# cube = pkgs.lib.nixosSystem { self.nixosModules.backup
# specialArgs = { inherit inputs outputs; }; self.nixosModules.wireguard
# modules = [ home-manager.nixosModules.home-manager
# ./hosts/cube {
# home-manager.nixosModules.home-manager home-manager.useGlobalPkgs = true;
# { home-manager.useUserPackages = true;
# home-manager.useGlobalPkgs = true; home-manager.users.anish = import ./home/core;
# home-manager.useUserPackages = true; }
# home-manager.users.anish = import ./home/core; ];
# } };
# ]; cube = nixpkgs.lib.nixosSystem rec {
# }; specialArgs = { inherit inputs self; };
# box = pkgs.lib.nixosSystem { system = "x86_64-linux";
# specialArgs = { inherit inputs outputs; }; pkgs = nixpkgsFor.${system};
# modules = [ modules = [
# ./hosts/box ./hosts/cube
# home-manager.nixosModules.home-manager agenix.nixosModules.age
# { self.nixosModules.backup
# home-manager.useGlobalPkgs = true; self.nixosModules.wireguard
# home-manager.useUserPackages = true; basant.nixosModule
# home-manager.users.anish = import ./home/core; home-manager.nixosModules.home-manager
# } {
# ]; home-manager.useGlobalPkgs = true;
# }; home-manager.useUserPackages = true;
home-manager.users.anish = import ./home/core;
}
];
};
box = nixpkgs.lib.nixosSystem rec {
specialArgs = { inherit inputs self; };
system = "x86_64-linux";
pkgs = nixpkgsFor.${system};
modules = [
./hosts/box
agenix.nixosModules.age
self.nixosModules.backup
self.nixosModules.wireguard
self.nixosModules.wallabag
self.nixosModules.gonic
grasp.nixosModule
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.anish = import ./home/core;
}
];
};
}; };
# Standalone home-manager configuration entrypoint # Standalone home-manager configuration entrypoint
@ -189,17 +215,38 @@
extraSpecialArgs = { inherit inputs; }; extraSpecialArgs = { inherit inputs; };
modules = [ modules = [
./home/core.nix ./home/core.nix
./home/profiles/firefox
]; ];
}; };
}; };
deploy.nodes = { deploy.nodes = {
curve.profiles.system = { curve.profiles.system = {
user = "root"; user = "anish";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.curve; path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.curve;
}; };
box.profiles.system = {
user = "anish";
hostname = "mossnet.lan";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.box;
};
helix.profiles.system = {
user = "anish";
hostname = "sealight.xyz";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.helix;
};
lituus.profiles.system = {
user = "anish";
hostname = "git.sealight.xyz";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.lituus;
};
cube.profiles.system = {
user = "anish";
hostname = "anish.lakhwara.com";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.cube;
};
}; };
# checks = builtins.mapAttrs (system: deploy-rsLib: deployLib.deployChecks self.deploy) deploy.lib; checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
}; };
} }

View file

@ -7,4 +7,5 @@
../profiles/git ../profiles/git
../profiles/task ../profiles/task
]; ];
home.stateVersion = "22.05";
} }

View file

@ -2,7 +2,6 @@
{ {
imports = [ imports = [
./configuration.nix ./configuration.nix
../users/anish
../profiles/core ../profiles/core
../profiles/server ../profiles/server
../profiles/taskd ../profiles/taskd

View file

@ -49,4 +49,5 @@
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
nixpkgs.hostPlatform = "x86_64-linux";
} }

View file

@ -5,7 +5,8 @@
{ {
imports = imports =
[ (modulesPath + "/profiles/qemu-guest.nix") [
(modulesPath + "/profiles/qemu-guest.nix")
]; ];
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ]; boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ];
@ -14,16 +15,19 @@
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" =
{ device = "/dev/disk/by-uuid/9233d8be-539f-43c8-9b83-84b5b4d72a93"; {
device = "/dev/disk/by-uuid/9233d8be-539f-43c8-9b83-84b5b4d72a93";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/E00D-9070"; {
device = "/dev/disk/by-uuid/E00D-9070";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = [ ]; swapDevices = [ ];
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
nixpkgs.hostPlatform = "x86_64-linux";
} }

View file

@ -1,4 +1,4 @@
{ self, inputs, pkgs, ... }: { self, pkgs, ... }:
{ {
imports = [ imports = [
./configuration.nix ./configuration.nix

View file

@ -47,4 +47,5 @@
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
nixpkgs.hostPlatform = "x86_64-linux";
} }

View file

@ -10,18 +10,6 @@
../profiles/wireguard-server ../profiles/wireguard-server
]; ];
# Capsul specific
users.users.cyberian = {
isNormalUser = true;
extraGroups = [ "wheel" ];
};
mossnet.wg = {
enable = true;
ips = [ "10.0.69.5/24" ];
privateKeyFile = "/home/anish/wg/wg-priv";
};
# mossnet.backup = { # mossnet.backup = {
# enable = false; # enable = false;
# name = "sealight"; # name = "sealight";
@ -34,4 +22,5 @@
# databases = [ "matrix-synapse" "gitea" ]; # databases = [ "matrix-synapse" "gitea" ];
# location = "/var/backup/postgresql"; # location = "/var/backup/postgresql";
# }; # };
} }

View file

@ -23,4 +23,5 @@
swapDevices = [ ]; swapDevices = [ ];
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
nixpkgs.hostPlatform = "x86_64-linux";
} }

View file

@ -2,7 +2,6 @@
{ {
imports = [ imports = [
./configuration.nix ./configuration.nix
../users/anish
../profiles/core ../profiles/core
../profiles/server ../profiles/server
../profiles/metrics ../profiles/metrics
@ -12,4 +11,16 @@
../profiles/freshrss ../profiles/freshrss
]; ];
# Capsul specific
users.users.cyberian = {
isNormalUser = true;
extraGroups = [ "wheel" ];
};
mossnet.wg = {
enable = true;
ips = [ "10.0.69.5/24" ];
privateKeyFile = "/home/anish/wg/wg-priv";
};
} }

View file

@ -23,4 +23,5 @@
swapDevices = [ ]; swapDevices = [ ];
nix.maxJobs = lib.mkDefault 1; nix.maxJobs = lib.mkDefault 1;
nixpkgs.hostPlatform = "x86_64-linux";
} }

View file

@ -2,7 +2,7 @@
let inherit (lib) fileContents; let inherit (lib) fileContents;
in in
{ {
imports = [ ../cachix ]; imports = [ ../../users/anish ];
fonts = { fonts = {

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }: { self, config, lib, pkgs, ... }:
{ {
age.secrets.freshrss-dbpass.file = "${self}/secrets/freshrss-dbpass.age"; age.secrets.freshrss-dbpass.file = "${self}/secrets/freshrss-dbpass.age";
@ -7,6 +7,7 @@
enable = true; enable = true;
virtualHost = "rss.sealight.xyz"; virtualHost = "rss.sealight.xyz";
baseUrl = "https://rss.sealight.xyz/"; baseUrl = "https://rss.sealight.xyz/";
passwordFile = "/run/agenix/freshrss-dbpass";
database = { database = {
type = "pgsql"; type = "pgsql";
passFile = "/run/agenix/freshrss-dbpass"; passFile = "/run/agenix/freshrss-dbpass";

View file

@ -2,9 +2,11 @@
# grafana configuration # grafana configuration
services.grafana = { services.grafana = {
enable = true; enable = true;
domain = "stats.mossnet.lan"; settings.server = {
port = 2342; domain = "stats.mossnet.lan";
addr = "127.0.0.1"; http_port = 2342;
http_addr = "127.0.0.1";
};
}; };
# nginx reverse proxy # nginx reverse proxy
@ -26,7 +28,7 @@
port = 9002; port = 9002;
}; };
dnsmasq = { dnsmasq = {
enable = true; enable = false;
port = 9153; port = 9153;
}; };
}; };

View file

@ -5,6 +5,7 @@
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
path = [ path = [
pkgs.git pkgs.git
pkgs.openssh
pkgs.coreutils pkgs.coreutils
]; ];
script = '' script = ''

View file

@ -1,4 +1,4 @@
{ pkgs, inputs, ... }: { pkgs, ... }:
{ {
systemd.services.website-deploy = { systemd.services.website-deploy = {
@ -8,7 +8,7 @@
pkgs.coreutils pkgs.coreutils
pkgs.nixUnstable pkgs.nixUnstable
pkgs.openssh pkgs.openssh
inputs.deploy.packages.${pkgs.system}.deploy-rs pkgs.deploy
]; ];
script = '' script = ''
cd /etc/nixos/ # TODO make variable cd /etc/nixos/ # TODO make variable

View file

@ -1,8 +1,6 @@
{ hmUsers, pkgs, ... }: { pkgs, ... }:
{ {
#home-manager.users = { inherit (hmUsers) anish; };
users.users.anish = { users.users.anish = {
description = "Personal user for Anish"; description = "Personal user for Anish";
hashedPassword = "$y$j9T$y3DPt/dWaPE.gRazQqw1w0$1RMH5sl/Nu8kW3ZMywYCPRniHD/jF5qRh0VKrdJ.bV2"; hashedPassword = "$y$j9T$y3DPt/dWaPE.gRazQqw1w0$1RMH5sl/Nu8kW3ZMywYCPRniHD/jF5qRh0VKrdJ.bV2";
@ -16,16 +14,4 @@
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDtU2GMYjXj6RGO1+mwM4TDGOo0qrKLTL4Di8+QgDX0p5vUEsnE1PS9wnuqCmSu75U8g0XIAMtvtdYyGk1N+Bx01erAZpT8DLYtIXFCyaiN28PVu5T1D0T+TQ7xgIH1qenXZR2DOQdf6kpvKEfm7+7bWhCo0N/KFMpmReubyzHDQcq/1qQasxTL+YALQFOjwKqsOTBXbHwZ103AEAcQX4ftBFEOfVli4/1aKIK4dNSZYB7J9Htq707YnsEqo9RLAMh0aOTTYgTx9AoSUDeqGuh/AGkcB7NcS7EEtI6d5YUGylwZh/gF6hqE0jl8kn2m5jMKXL3CRohZvjifue8x/GIjpu5WRabUuhBEbrfTQQaC7taHnt5rvYCGzKZx09TexUzhuz2CL480DRoxSG+P+lCNm1dIg/EZrnGEzXCSr36PlOqS5t5gm8tPkzCmZf2wU15A3ZIYUPmnYLqsn4WmIV7rKmdqt2ctWELUXow3PPiZXBucP9P3xpsYEfF1SB2SGNc= u0_a139@localhost" "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDtU2GMYjXj6RGO1+mwM4TDGOo0qrKLTL4Di8+QgDX0p5vUEsnE1PS9wnuqCmSu75U8g0XIAMtvtdYyGk1N+Bx01erAZpT8DLYtIXFCyaiN28PVu5T1D0T+TQ7xgIH1qenXZR2DOQdf6kpvKEfm7+7bWhCo0N/KFMpmReubyzHDQcq/1qQasxTL+YALQFOjwKqsOTBXbHwZ103AEAcQX4ftBFEOfVli4/1aKIK4dNSZYB7J9Htq707YnsEqo9RLAMh0aOTTYgTx9AoSUDeqGuh/AGkcB7NcS7EEtI6d5YUGylwZh/gF6hqE0jl8kn2m5jMKXL3CRohZvjifue8x/GIjpu5WRabUuhBEbrfTQQaC7taHnt5rvYCGzKZx09TexUzhuz2CL480DRoxSG+P+lCNm1dIg/EZrnGEzXCSr36PlOqS5t5gm8tPkzCmZf2wU15A3ZIYUPmnYLqsn4WmIV7rKmdqt2ctWELUXow3PPiZXBucP9P3xpsYEfF1SB2SGNc= u0_a139@localhost"
]; ];
}; };
home-manager.users.anish.home.stateVersion = "22.05";
# home-manager.users.anish.programs.git = {
# userName = "Anish Lakhwara";
# userEmail = "anish+git@lakhwara.com";
# delta.enable = true;
# };
#home-manager.users.anish = { suites, ... }: {
# imports = suites.gui;
#};
} }

View file

@ -89,7 +89,7 @@ in
services.phpfpm.pools."${poolName}" = { services.phpfpm.pools."${poolName}" = {
user = "${cfg.user}"; user = "${cfg.user}";
group = "nginx"; group = "nginx";
phpPackage = pkgs.php74; phpPackage = pkgs.php;
settings = { settings = {
"listen.owner" = "nginx"; "listen.owner" = "nginx";
"listen.group" = "nginx"; "listen.group" = "nginx";
@ -155,7 +155,7 @@ in
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
before = [ "phpfpm-wallabag.service" ]; before = [ "phpfpm-wallabag.service" ];
after = [ "mysql.service" "postgresql.service" ]; after = [ "mysql.service" "postgresql.service" ];
path = with pkgs; [ coreutils php74 php74Packages.composer ]; path = with pkgs; [ coreutils php phpPackages.composer ];
serviceConfig = { serviceConfig = {
User = cfg.user; User = cfg.user;