diff --git a/config/hosts/beltane/home/default.nix b/config/hosts/beltane/home/default.nix new file mode 100644 index 00000000..3fbabbc7 --- /dev/null +++ b/config/hosts/beltane/home/default.nix @@ -0,0 +1 @@ +{ ... }: { imports = [ ./sway ]; } diff --git a/config/hosts/beltane/home/sway/default.nix b/config/hosts/beltane/home/sway/default.nix new file mode 100644 index 00000000..aa2895f2 --- /dev/null +++ b/config/hosts/beltane/home/sway/default.nix @@ -0,0 +1,46 @@ +{ config, pkgs, ... }: + +{ + imports = [ ./swayidle.nix ]; + + wayland.windowManager.sway = { + config = + let + lockCommand = "swaylock -i VGA-1:${../../../../users/kat/sway/wallpapers/main.png} -s fill"; + cfg = config.wayland.windowManager.sway.config; + in + { + #startup = [{ command = "${pkgs.ckb-next}/bin/ckb-next -b"; }]; + + output = + let + middle = { + res = "1280x1024@75Hz"; + pos = "1920 0"; + }; + in + { + "VGA-1" = middle; + }; + + keybindings = { + "${cfg.modifier}+x" = "exec ${lockCommand}"; + }; + + modes = { + "System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown" = + { + "l" = "exec ${lockCommand}, mode default"; + "e" = "exec swaymsg exit, mode default"; + "s" = "exec systemctl suspend, mode default"; + "h" = "exec systemctl hibernate, mode default"; + "r" = "exec systemctl reboot, mode default"; + "Shift+s" = "exec systemctl shutdown, mode default"; + "Return" = "mode default"; + "Escape" = "mode default"; + }; + }; + + }; + }; +} diff --git a/config/hosts/beltane/home/sway/swayidle.nix b/config/hosts/beltane/home/sway/swayidle.nix new file mode 100644 index 00000000..8cb9152b --- /dev/null +++ b/config/hosts/beltane/home/sway/swayidle.nix @@ -0,0 +1,28 @@ +{ config, pkgs, lib, ... }: + +{ + systemd.user.services.swayidle = { + Unit = { + Description = "swayidle"; + Documentation = [ "man:swayidle(1)" ]; + PartOf = [ "graphical-session.target" ]; + }; + Service = { + Type = "simple"; + ExecStart = '' + ${pkgs.swayidle}/bin/swayidle -w \ + timeout 300 '${pkgs.swaylock}/bin/swaylock -f -i VGA-1:${ + ../../../../users/kat/sway/wallpapers/main.png + } \ + timeout 600 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep '${pkgs.swaylock}/bin/swaylock -f -i VGA-1:${ + ../../../../users/kat/sway/wallpapers/main.png + }' + ''; + RestartSec = 3; + Restart = "always"; + }; + Install = { WantedBy = [ "sway-session.target" ]; }; + }; +} diff --git a/config/hosts/beltane/meta.nix b/config/hosts/beltane/meta.nix new file mode 100644 index 00000000..69cf5e53 --- /dev/null +++ b/config/hosts/beltane/meta.nix @@ -0,0 +1,24 @@ +{ lib, config, ... }: with lib; { + config = { + deploy.targets.beltane = { + nodeNames = lib.singleton "beltane"; + tf = { + resources.beltane = { + provider = "null"; + type = "resource"; + connection = { + port = 62954; + host = "192.168.1.223"; + }; + }; + }; + }; + network.nodes.beltane = { + imports = lib.hostImport "beltane"; + networking = { + hostName = "beltane"; + }; + }; + }; +} + diff --git a/config/hosts/beltane/nixos/default.nix b/config/hosts/beltane/nixos/default.nix new file mode 100644 index 00000000..d4321d8d --- /dev/null +++ b/config/hosts/beltane/nixos/default.nix @@ -0,0 +1,36 @@ +{ config, pkgs, profiles, users, tf, ... }: + +{ + imports = [ + ./hw.nix + profiles.gui + profiles.sway + users.kat.guiFull + ../../../services/zfs.nix + ]; + + home-manager.users.kat = { + imports = [ + ../home + ]; + }; + + boot.loader.grub.enable = true; + boot.loader.grub.efiSupport = true; + boot.loader.grub.device = "nodev"; + boot.loader.grub.mirroredBoots = [ + { devices = [ "/dev/disk/by-uuid/4520-4E5F" ]; + path = "/boot-fallback"; } + ]; + boot.supportedFilesystems = [ "zfs" ]; + boot.loader.efi.canTouchEfiVariables = true; + networking.hostName = "beltane"; + networking.hostId = "3ef9a419"; + + networking.useDHCP = false; + networking.interfaces.eno1.useDHCP = true; + + system.stateVersion = "21.05"; + +} + diff --git a/config/hosts/beltane/nixos/hw.nix b/config/hosts/beltane/nixos/hw.nix new file mode 100644 index 00000000..fbce1d4a --- /dev/null +++ b/config/hosts/beltane/nixos/hw.nix @@ -0,0 +1,45 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "ata_generic" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "zroot/safe/root"; + fsType = "zfs"; + }; + + fileSystems."/nix" = + { device = "zroot/local/nix"; + fsType = "zfs"; + }; + + fileSystems."/home" = + { device = "zroot/safe/home"; + fsType = "zfs"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/44CC-7137"; + fsType = "vfat"; + }; + + fileSystems."/boot-fallback" = + { device = "/dev/disk/by-uuid/4520-4E5F"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/682df001-bad8-4d94-a86b-9068ce5eee4c"; } + { device = "/dev/disk/by-uuid/1ee2d322-235c-41de-b272-7ceded4e2624"; } + ]; + } diff --git a/default.nix b/default.nix index 4bacbfc0..21aeee70 100644 --- a/default.nix +++ b/default.nix @@ -32,6 +32,7 @@ let ./config/modules/meta/default.nix ./config/hosts/dummy/meta.nix ./config/hosts/athame/meta.nix + ./config/hosts/beltane/meta.nix ./config/hosts/samhain/meta.nix ./config/hosts/yule/meta.nix ./config/hosts/mabon/meta.nix