From 623c33a30d2987e6366b04bbf63b0e389447a366 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Fri, 8 Sep 2023 15:17:08 +0200 Subject: works? --- host/Rory-devenv/software.nix | 2 -- host/RoryNix/configuration.nix | 34 +---------------------- modules/base-client.nix | 61 ++++++++++++++++++++++++++++++++++++++++++ modules/base.nix | 17 +++--------- modules/environments/home.nix | 39 +++++++++++++++++++++++++++ modules/extra-substituters.nix | 17 ++++++++++++ 6 files changed, 121 insertions(+), 49 deletions(-) create mode 100755 modules/base-client.nix create mode 100755 modules/environments/home.nix create mode 100644 modules/extra-substituters.nix diff --git a/host/Rory-devenv/software.nix b/host/Rory-devenv/software.nix index 2d26885..af07bdf 100755 --- a/host/Rory-devenv/software.nix +++ b/host/Rory-devenv/software.nix @@ -55,11 +55,9 @@ }; environment.systemPackages = with pkgs; [ - zsh gnome-console kitty feh - lsd sshfs cinnamon.nemo firefox-bin diff --git a/host/RoryNix/configuration.nix b/host/RoryNix/configuration.nix index a5dbf3b..aa079e8 100644 --- a/host/RoryNix/configuration.nix +++ b/host/RoryNix/configuration.nix @@ -5,6 +5,7 @@ [ # ./hardware-configuration.nix ../../modules/packages/vim.nix + ../../modules/environments/home.nix ]; boot = { @@ -159,40 +160,7 @@ sudo.wheelNeedsPassword = false; }; - nix = { - distributedBuilds = true; - - buildMachines = [ - #"self" = { - # - #}; - { - systems = [ "x86_64-linux" "i686-linux" ]; - hostName = "192.168.0.3"; - sshUser = "Rory"; - sshKey = "/home/Rory/.ssh/id_ed25519"; - maxJobs = 6; - #cores = 2; - speedFactor = 43200; - } - ]; - #buildersUseSubstitutes = true; - #ssh://Rory@192.168.0.3 x86_64-linux,i686-linux /home/Rory/.ssh/id_ed25519 12 1 - - - - #registry.nixpkgs.flake = pkgs; - nixPath = [ "nixpkgs=flake:nixpkgs" ]; - settings.trusted-substituters = [ - "https://nix-community.cachix.org" - "https://cache.garnix.io" - "https://numtide.cachix.org" - ]; - settings.trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" - "numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE=" - ]; - - }; system.stateVersion = "22.11"; # DO NOT EDIT! } diff --git a/modules/base-client.nix b/modules/base-client.nix new file mode 100755 index 0000000..1f482ee --- /dev/null +++ b/modules/base-client.nix @@ -0,0 +1,61 @@ +{ config, pkgs, lib, ... }: + +{ + imports = + [ + ./base.nix + ]; + + networking = { + hostName = lib.mkDefault "Rory-nix-base"; + firewall = { + enable = false; + # allowedTCPPorts = [ ... ]; + # allowedUDPPorts = [ ... ]; + }; + }; + + i18n.defaultLocale = "en_US.UTF-8"; + + systemd = { + sleep.extraConfig = '' + AllowSuspend=no + AllowHibernation=no + ''; + }; + + environment.systemPackages = with pkgs; [ + # - cli utils + sshfs + + # - gui utils + gnome-console + cinnamon.nemo + feh + udisks + gparted + ]; + + fonts.fonts = with pkgs; [ + (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) + ]; + + systemd.coredump.extraConfig = lib.mkDefault '' + Storage=none + ''; + nix = { + settings = { + experimental-features = [ "nix-command" "flakes" ]; + auto-optimise-store = true; + }; + }; + nixpkgs = { + config.allowUnfree = true; + }; + security = { + polkit.enable = true; + sudo.wheelNeedsPassword = false; + }; + + system.stateVersion = "22.11"; # DO NOT EDIT! +} diff --git a/modules/base.nix b/modules/base.nix index 7364dfa..6a10a84 100755 --- a/modules/base.nix +++ b/modules/base.nix @@ -5,7 +5,9 @@ [ ./packages/vim.nix ./users/Rory.nix + ./extra-substituters.nix ]; + boot = { kernelParams = [ "memory_hotplug.memmap_on_memory=1" @@ -14,6 +16,7 @@ "net.ipv4.tcp_congestion_control=bbr" ]; } + networking = { hostName = lib.mkDefault "Rory-nix-base"; firewall = { @@ -23,7 +26,6 @@ }; }; - #time.timeZone = "Europe/Brussels"; i18n.defaultLocale = "en_US.UTF-8"; services = { @@ -54,11 +56,8 @@ duf htop btop - #sshfs duf kitty.terminfo - neovim -# vimPlugins.vim-nix tmux jq yq @@ -70,16 +69,6 @@ systemd.coredump.extraConfig = lib.mkDefault '' Storage=none ''; - nix.settings.trusted-substituters = [ - "https://nix-community.cachix.org" - "https://cache.garnix.io" - "https://numtide.cachix.org" - ]; - nix.settings.trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" - "numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE=" - ]; nix = { settings = { experimental-features = [ "nix-command" "flakes" ]; diff --git a/modules/environments/home.nix b/modules/environments/home.nix new file mode 100755 index 0000000..53ee357 --- /dev/null +++ b/modules/environments/home.nix @@ -0,0 +1,39 @@ +{ config, pkgs, lib, ... }: + +{ + nix = { + distributedBuilds = true; + + buildMachines = [ + #"self" = { + # + #}; + { + systems = [ "x86_64-linux" "i686-linux" ]; + hostName = "192.168.0.3"; + sshUser = "Rory"; + sshKey = "/home/Rory/.ssh/id_ed25519"; + maxJobs = 6; + #cores = 2; + speedFactor = 43200; + } + ]; + buildersUseSubstitutes = true; + #ssh://Rory@192.168.0.3 x86_64-linux,i686-linux /home/Rory/.ssh/id_ed25519 12 1 - - - + registry.nixpkgs.flake = pkgs; + nixPath = [ "nixpkgs=flake:nixpkgs" ]; + settings = { + trusted-substituters = [ + "https://nix-community.cachix.org" + "https://cache.garnix.io" + "https://numtide.cachix.org" + ]; + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" + "numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE=" + ]; + }; + }; + system.stateVersion = "22.11"; # DO NOT EDIT! +} diff --git a/modules/extra-substituters.nix b/modules/extra-substituters.nix new file mode 100644 index 0000000..e6b24a8 --- /dev/null +++ b/modules/extra-substituters.nix @@ -0,0 +1,17 @@ +{ config, pkgs, lib, ... }: + +{ + nix.settings.trusted-substituters = [ + "https://nix-community.cachix.org" + "https://cache.garnix.io" + "https://numtide.cachix.org" + ]; + + nix.settings.trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" + "numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE=" + ]; + + system.stateVersion = "22.11"; # DO NOT EDIT! +} -- cgit 1.4.1