diff --git a/nixos/logical/blackadder.nix b/nixos/logical/blackadder.nix index b34e10d..36ed6ab 100644 --- a/nixos/logical/blackadder.nix +++ b/nixos/logical/blackadder.nix @@ -1,8 +1,6 @@ { config, pkgs, lib, ... }: { imports = [ ../physical/3950x.nix ../roles/workstation.nix ]; - nix.nixPath = [ "nixpkgs=${pkgs.path}" ]; - system.stateVersion = "19.09"; yorick.lumi-vpn = { @@ -10,8 +8,7 @@ mtu = 1408; }; - xdg.autostart.enable = false; - + # backups services.znapzend = { enable = true; pure = true; @@ -31,12 +28,8 @@ }; }; - services.udev.extraRules = '' - SUBSYSTEM=="usb", ATTRS{idVendor}=="20b7", ATTRS{idProduct}=="9db1", MODE="0660", GROUP="dialout", TAG+="uaccess" - ''; - + # lars user nix.settings.trusted-users = [ "lars" ]; - users.users.yorick.extraGroups = [ "docker" ]; users.users.lars = { isNormalUser = true; openssh.authorizedKeys.keys = [ @@ -44,8 +37,8 @@ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOvdQ963wjgWyFMp6djRTqVwZr3/PQ/V+Qm5JTcxRTdY lumi@channelwood" ]; }; + + # docker virtualisation.docker.enable = true; - # castnow - networking.firewall.allowedUDPPorts = [ 5353 ]; - networking.firewall.allowedTCPPortRanges = [ { from = 4100; to = 4105; } ]; + users.users.yorick.extraGroups = [ "docker" ]; } diff --git a/nixos/logical/smithers.nix b/nixos/logical/smithers.nix index 8b89c55..f1f1999 100644 --- a/nixos/logical/smithers.nix +++ b/nixos/logical/smithers.nix @@ -1,35 +1,9 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - { config, pkgs, lib, ... }: -let sources = import ../../nix/sources.nix; -in { - imports = - [ # Include the results of the hardware scan. - "${sources.nixos-hardware}/lenovo/thinkpad/x1" - ../physical/x11-hardware-config.nix - ../roles/workstation.nix +{ + imports = [ ../physical/x11.nix ../roles/workstation.nix ]; - ]; yorick.lumi-vpn.enable = lib.mkForce false; - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - boot.zfs.requestEncryptionCredentials = true; - - networking.hostName = "smithers"; - networking.wireless.iwd.enable = true; - networking.hostId = "54a8968e"; - - hardware.bluetooth.enable = true; - services.fprintd.enable = true; system.stateVersion = "21.05"; - boot.kernelPackages = pkgs.linuxPackages_5_15; - - boot.initrd.availableKernelModules = [ "i915" ]; - boot.loader.timeout = 1; - boot.kernelParams = ["i915.fastboot=1" "i915.enable_psr=0" ]; # todo: 2?, "quiet" - #boot.plymouth.enable = true; } diff --git a/nixos/modules/lumi-cache.nix b/nixos/modules/lumi-cache.nix new file mode 100644 index 0000000..71aaaf5 --- /dev/null +++ b/nixos/modules/lumi-cache.nix @@ -0,0 +1,30 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.yorick.lumi-cache; + nixNetrcFile = pkgs.runCommand "nix-netrc-file" { + hostname = "cache.lumi.guide"; + username = "lumi"; + } '' + cat > $out <; -in { config, lib, pkgs, ... }: { - imports = [ ./. ]; - options.yorick.support32bit = with lib; - mkOption { - type = types.bool; - default = false; - }; - config = { - hardware.opengl = { - enable = true; - driSupport32Bit = config.yorick.support32bit; - }; - users.users.yorick.extraGroups = [ "video" ]; - # fix backlight permissions - services.udev.extraRules = '' - ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness" - ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness" - ''; - - fonts = { - fontDir.enable = true; - enableGhostscriptFonts = true; - fonts = with pkgs; [ - corefonts # Micrsoft free fonts - inconsolata # monospaced - source-code-pro - ubuntu_font_family # Ubuntu fonts - source-han-sans-japanese - iosevka - font-awesome - ]; - }; - # spotify - networking.firewall.allowedTCPPorts = [ 55025 57621 ]; - networking.firewall.allowedUDPPorts = [ 55025 57621 ]; - - services.openssh.forwardX11 = true; - - programs.sway = { - enable = true; - extraSessionCommands = '' - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${ - lib.makeLibraryPath (with pkgs; [ libxkbcommon libglvnd wayland ]) - } - ''; - }; - }; -} diff --git a/nixos/roles/workstation.nix b/nixos/roles/workstation.nix index e3b462e..ab9f717 100644 --- a/nixos/roles/workstation.nix +++ b/nixos/roles/workstation.nix @@ -1,87 +1,54 @@ { config, lib, pkgs, ... }: -let - nixNetrcFile = pkgs.runCommand "nix-netrc-file" { - hostname = "cache.lumi.guide"; - username = "lumi"; - } '' - cat > $out <