feat: ds9 offsite
This commit is contained in:
parent
3c787359f5
commit
fb42273014
4 changed files with 163 additions and 98 deletions
29
flake.nix
29
flake.nix
|
|
@ -62,9 +62,11 @@
|
||||||
|
|
||||||
rev = if (lib.hasAttrByPath [ "rev" ] self.sourceInfo) then self.sourceInfo.rev else "Dirty Build";
|
rev = if (lib.hasAttrByPath [ "rev" ] self.sourceInfo) then self.sourceInfo.rev else "Dirty Build";
|
||||||
|
|
||||||
nixosSystem = system: extraModules: hostName: let
|
nixosSystem = system: extraModules: hostName:
|
||||||
|
let
|
||||||
pkgs = genPkgs system;
|
pkgs = genPkgs system;
|
||||||
in nixpkgs.lib.nixosSystem
|
in
|
||||||
|
nixpkgs.lib.nixosSystem
|
||||||
rec {
|
rec {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = { inherit lib inputs pkgs system; };
|
specialArgs = { inherit lib inputs pkgs system; };
|
||||||
|
|
@ -82,23 +84,25 @@
|
||||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
home-manager.extraSpecialArgs = { inherit inputs; };
|
||||||
}
|
}
|
||||||
|
|
||||||
(lib.mkIf config.ragon.user.enable { # import hm stuff if enabled
|
(lib.mkIf config.ragon.user.enable {
|
||||||
|
# import hm stuff if enabled
|
||||||
home-manager.users.ragon = hmConfig;
|
home-manager.users.ragon = hmConfig;
|
||||||
})
|
})])
|
||||||
])
|
|
||||||
./nixos-common.nix
|
./nixos-common.nix
|
||||||
] ++ (lib.my.mapModulesRec' (toString ./nixos-modules) import) ++ extraModules;
|
] ++ (lib.my.mapModulesRec' (toString ./nixos-modules) import) ++ extraModules;
|
||||||
};
|
};
|
||||||
darwinSystem = system: extraModules: hostName:
|
darwinSystem = system: extraModules: hostName:
|
||||||
let
|
let
|
||||||
pkgs = genPkgs system;
|
pkgs = genPkgs system;
|
||||||
in darwin.lib.darwinSystem
|
in
|
||||||
|
darwin.lib.darwinSystem
|
||||||
{
|
{
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = { inherit darwin lib pkgs inputs self; };
|
specialArgs = { inherit darwin lib pkgs inputs self; };
|
||||||
modules = [
|
modules = [
|
||||||
home-manager.darwinModules.home-manager
|
home-manager.darwinModules.home-manager
|
||||||
({ config, inputs, self, ...}: { config = {
|
({ config, inputs, self, ... }: {
|
||||||
|
config = {
|
||||||
#system.darwinLabel = "${config.system.darwinLabel}@${rev}";
|
#system.darwinLabel = "${config.system.darwinLabel}@${rev}";
|
||||||
networking.hostName = hostName;
|
networking.hostName = hostName;
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
|
|
@ -128,14 +132,17 @@
|
||||||
darwinModules = [ ];
|
darwinModules = [ ];
|
||||||
#darwinModules = lib.my.mapModulesRec ./darwin-modules import;
|
#darwinModules = lib.my.mapModulesRec ./darwin-modules import;
|
||||||
nixosConfigurations = processConfigurations {
|
nixosConfigurations = processConfigurations {
|
||||||
picard = nixosSystem "x86_64-linux" [ ./hosts/picard/default.nix ]; # TODO
|
picard = nixosSystem "x86_64-linux" [ ./hosts/picard/default.nix ];
|
||||||
ds9 = nixosSystem "x86_64-linux" [ ./hosts/ds9/default.nix ]; # TODO
|
ds9 = nixosSystem "x86_64-linux" [ ./hosts/ds9/default.nix ];
|
||||||
|
backuppi = nixosSystem "aarch64-linux" [ ./hosts/backuppi/default.nix ];
|
||||||
};
|
};
|
||||||
darwinConfigurations = processConfigurations {
|
darwinConfigurations = processConfigurations {
|
||||||
daedalus = darwinSystem "aarch64-darwin" [ ./hosts/daedalus/default.nix ]; # TODO
|
daedalus = darwinSystem "aarch64-darwin" [ ./hosts/daedalus/default.nix ];
|
||||||
};
|
};
|
||||||
|
|
||||||
} // utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; in {
|
} // utils.lib.eachDefaultSystem (system:
|
||||||
|
let pkgs = nixpkgs.legacyPackages.${system}; in
|
||||||
|
{
|
||||||
devShell = pkgs.mkShell {
|
devShell = pkgs.mkShell {
|
||||||
buildInputs = with pkgs; [ lefthook nixpkgs-fmt ];
|
buildInputs = with pkgs; [ lefthook nixpkgs-fmt ];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
47
hosts/backuppi/default.nix
Normal file
47
hosts/backuppi/default.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
{ config, inputs, pkgs, lib, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
"${inputs.nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
|
||||||
|
"${inputs.nixos-hardware}/raspberry-pi/4/default.nix"
|
||||||
|
];
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(final: super: {
|
||||||
|
makeModulesClosure = x:
|
||||||
|
super.makeModulesClosure (x // { allowMissing = true; });
|
||||||
|
})
|
||||||
|
];
|
||||||
|
boot.loader.systemd-boot.enable = false;
|
||||||
|
boot.kernelPackages = pkgs.linuxPackages_rpi3;
|
||||||
|
boot.supportedFilesystems = lib.mkForce [ "reiserfs" "vfat" "zfs" "ext4" ];
|
||||||
|
networking.hostId = "eec43f51";
|
||||||
|
# networking.usePredictableInterfaceNames = false;
|
||||||
|
documentation.enable = false;
|
||||||
|
documentation.nixos.enable = false;
|
||||||
|
|
||||||
|
nix = {
|
||||||
|
autoOptimiseStore = true;
|
||||||
|
gc = {
|
||||||
|
automatic = true;
|
||||||
|
dates = "weekly";
|
||||||
|
options = "--delete-older-than 30d";
|
||||||
|
};
|
||||||
|
# Free up to 1GiB whenever there is less than 100MiB left.
|
||||||
|
extraOptions = ''
|
||||||
|
min-free = ${toString (100 * 1024 * 1024)}
|
||||||
|
max-free = ${toString (1024 * 1024 * 1024)}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
powerManagement.cpuFreqGovernor = "ondemand";
|
||||||
|
|
||||||
|
# Assuming this is installed on top of the disk image.
|
||||||
|
fileSystems = {
|
||||||
|
"/" = {
|
||||||
|
device = "/dev/disk/by-label/NIXOS_SD";
|
||||||
|
fsType = "ext4";
|
||||||
|
options = [ "noatime" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
ragon.services.ssh.enable = true;
|
||||||
|
ragon.services.tailscale.enable = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -19,6 +19,17 @@ in
|
||||||
services.syncthing.enable = true;
|
services.syncthing.enable = true;
|
||||||
services.syncthing.user = "ragon";
|
services.syncthing.user = "ragon";
|
||||||
|
|
||||||
|
services.syncoid.command =
|
||||||
|
let
|
||||||
|
datasets = {
|
||||||
|
backups = "rpool/content/local/backups";
|
||||||
|
data = "rpool/content/safe/data";
|
||||||
|
ds9persist = "rpool/content/safe/persist";
|
||||||
|
hassosvm = "rpool/content/safe/vms/hassos";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
builtins.mapAttrs (n: v: { target = "backup/${n}"; source = v; sendOptions = [ "w" ]; }) datasets;
|
||||||
|
|
||||||
security.sudo.wheelNeedsPassword = false;
|
security.sudo.wheelNeedsPassword = false;
|
||||||
networking.useDHCP = true;
|
networking.useDHCP = true;
|
||||||
networking.bridges."br0".interfaces = [ ];
|
networking.bridges."br0".interfaces = [ ];
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue