From 7633581020138155012b9c0b860594ccd50a8e01 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Sat, 6 Nov 2021 12:06:38 +0300 Subject: [PATCH] Updates to raspi server --- flake.nix | 19 +++++++------------ machines/RasPi-Server/default.nix | 12 +++++++++--- machines/T420-Laptop/default.nix | 2 -- profiles/applications/himalaya.nix | 2 +- profiles/nix/default.nix | 2 +- profiles/overlay.nix | 2 +- roles/server.nix | 2 ++ 7 files changed, 21 insertions(+), 20 deletions(-) diff --git a/flake.nix b/flake.nix index c5ac4c8..f912792 100644 --- a/flake.nix +++ b/flake.nix @@ -130,21 +130,16 @@ deploy = { user = "root"; - nodes = (builtins.mapAttrs (_: machine: { + nodes = (builtins.mapAttrs (name: machine: + let activateable = name == "T420-Laptop" || name == "RasPi-Server"; in { hostname = machine.config.networking.hostName; profiles.system = { - user = "balsoft"; - path = deploy-rs.lib.x86_64-linux.activate.noop - machine.config.system.build.toplevel; + user = if activateable then "root" else "balsoft"; + path = with deploy-rs.lib.${machine.pkgs.system}.activate; if activateable + then nixos machine + else noop machine.config.system.build.toplevel; }; - }) self.nixosConfigurations) // { - T420-Laptop = { - hostname = - self.nixosConfigurations.T420-Laptop.config.networking.hostName; - profiles.system.path = deploy-rs.lib.x86_64-linux.activate.nixos - self.nixosConfigurations.T420-Laptop; - }; - }; + }) self.nixosConfigurations); }; }; } diff --git a/machines/RasPi-Server/default.nix b/machines/RasPi-Server/default.nix index cd31b03..3c435c2 100644 --- a/machines/RasPi-Server/default.nix +++ b/machines/RasPi-Server/default.nix @@ -1,8 +1,12 @@ -{ inputs, ... }: { - imports = with inputs.self.nixosModules; [ +{ inputs, pkgs, lib, ... }: { + imports = with inputs.self.nixosModules; with inputs.self.nixosProfiles; [ ./hardware-configuration.nix inputs.self.nixosRoles.server - mailserver + themes + fonts + cage + gtk + alacritty ]; boot.loader.raspberryPi = { @@ -10,6 +14,8 @@ version = 3; }; + nix.package = lib.mkForce pkgs.nixUnstable; + deviceSpecific.devInfo = { cpu = { vendor = "broadcom"; diff --git a/machines/T420-Laptop/default.nix b/machines/T420-Laptop/default.nix index 38fe23a..78abdb1 100644 --- a/machines/T420-Laptop/default.nix +++ b/machines/T420-Laptop/default.nix @@ -16,8 +16,6 @@ services.logind.lidSwitch = "ignore"; - security.sudo.wheelNeedsPassword = false; - deviceSpecific.devInfo = { legacy = true; cpu = { diff --git a/profiles/applications/himalaya.nix b/profiles/applications/himalaya.nix index d8d4cf6..cba3207 100644 --- a/profiles/applications/himalaya.nix +++ b/profiles/applications/himalaya.nix @@ -1,5 +1,5 @@ { config, pkgs, inputs, lib, ... }: { - environment.systemPackages = [ inputs.himalaya.defaultPackage.x86_64-linux ]; + environment.systemPackages = [ inputs.himalaya.defaultPackage.${pkgs.system} ]; home-manager.users.balsoft = { xdg.configFile."himalaya/config.toml".text = '' downloads-dir="/home/balsoft/Downloads/mail" diff --git a/profiles/nix/default.nix b/profiles/nix/default.nix index f33c708..77d2f0f 100644 --- a/profiles/nix/default.nix +++ b/profiles/nix/default.nix @@ -23,7 +23,7 @@ "serokell-1:aIojg2Vxgv7MkzPJoftOO/I8HKX622sT+c0fjnZBLj0=" ]; - package = inputs.nix.defaultPackage.x86_64-linux.overrideAttrs (oa: { + package = inputs.nix.defaultPackage.${pkgs.system}.overrideAttrs (oa: { patches = [ ./nix.patch ./unset-is-macho.patch ] ++ oa.patches or [ ]; # HAHA doInstallCheck = false; diff --git a/profiles/overlay.nix b/profiles/overlay.nix index 0e64c2f..4f17875 100644 --- a/profiles/overlay.nix +++ b/profiles/overlay.nix @@ -2,7 +2,7 @@ let filterGit = builtins.filterSource (type: name: name != ".git" || type != "directory"); - system = "x86_64-linux"; + inherit (pkgs) system; old = import inputs.nixpkgs-old ({ config = config.nixpkgs.config; localSystem = { inherit system; }; diff --git a/roles/server.nix b/roles/server.nix index 6dae84d..e40eeea 100644 --- a/roles/server.nix +++ b/roles/server.nix @@ -2,4 +2,6 @@ imports = [ ./base.nix ]; + + security.sudo.wheelNeedsPassword = false; }