diff --git a/helpers/home-manager-gen-colin.nix b/helpers/home-manager-gen-colin.nix index 53cfd635..16971eba 100644 --- a/helpers/home-manager-gen-colin.nix +++ b/helpers/home-manager-gen-colin.nix @@ -1,6 +1,6 @@ # system is e.g. x86_64-linux # gui is "gnome", or null -{ pkgs, system, gui }: { +{ lib, pkgs, system, gui, extraPackages ? [] }: { home.stateVersion = "21.11"; home.username = "colin"; home.homeDirectory = "/home/colin"; @@ -36,7 +36,7 @@ ''; }; - dconf.settings = if gui == "gnome" then { + dconf.settings = lib.mkIf (gui == "gnome") { # control alt-tab behavior "org/gnome/desktop/wm/keybindings" = { switch-applications = [ "Tab" ]; @@ -50,9 +50,9 @@ sleep-inactive-ac-type = "nothing"; sleep-inactive-battery-timeout = 5400; # seconds }; - } else null; + }; - programs.firefox = if gui != null then { + programs.firefox = lib.mkIf (gui != null) { enable = true; # empty profile required to allow extensions below profiles.default = { @@ -69,7 +69,7 @@ pkgs.nur.repos.rycee.firefox-addons.sponsorblock pkgs.nur.repos.rycee.firefox-addons.ublock-origin ]; - } else null; + }; home.packages = [ pkgs.btrfs-progs @@ -90,7 +90,6 @@ pkgs.lm_sensors # for sensors-detect pkgs.lsof pkgs.pciutils - pkgs.matrix-synapse pkgs.mix2nix pkgs.netcat pkgs.nixUnstable @@ -122,5 +121,6 @@ ++ (if system == "x86_64-linux" then [ # x86_64 only pkgs.discord - ] else []); + ] else []) + ++ extraPackages; } diff --git a/machines/desko/default.nix b/machines/desko/default.nix index 785fcdb1..4831e98f 100644 --- a/machines/desko/default.nix +++ b/machines/desko/default.nix @@ -1,4 +1,4 @@ -{ home-manager, config, pkgs, ... }: +{ home-manager, config, pkgs, lib, ... }: { imports = [ ./../common/home-manager.nix @@ -9,6 +9,8 @@ ]; home-manager.users.colin = import ./../../helpers/home-manager-gen-colin.nix { - inherit pkgs; system = "x86_64-linux"; gui = "gnome"; + inherit pkgs lib; + system = "x86_64-linux"; + gui = "gnome"; }; } diff --git a/machines/lappy/default.nix b/machines/lappy/default.nix index 785fcdb1..4831e98f 100644 --- a/machines/lappy/default.nix +++ b/machines/lappy/default.nix @@ -1,4 +1,4 @@ -{ home-manager, config, pkgs, ... }: +{ home-manager, config, pkgs, lib, ... }: { imports = [ ./../common/home-manager.nix @@ -9,6 +9,8 @@ ]; home-manager.users.colin = import ./../../helpers/home-manager-gen-colin.nix { - inherit pkgs; system = "x86_64-linux"; gui = "gnome"; + inherit pkgs lib; + system = "x86_64-linux"; + gui = "gnome"; }; } diff --git a/machines/uninsane/colin.nix b/machines/uninsane/colin.nix deleted file mode 100644 index e91d7f09..00000000 --- a/machines/uninsane/colin.nix +++ /dev/null @@ -1,91 +0,0 @@ -# docs: -# https://rycee.gitlab.io/home-manager/ -# man home-configuration.nix - -{ config, pkgs, ... }: -{ - - home.stateVersion = "21.11"; - home.username = "colin"; - home.homeDirectory = "/home/colin"; - programs.home-manager.enable = true; - programs.zsh.enable = true; - programs.git = { - enable = true; - userName = "colin"; - userEmail = "colin@uninsane.org"; - }; - - programs.vim = { - enable = true; - extraConfig = '' - " wtf vim project: NOBODY LIKES MOUSE FOR VISUAL MODE - set mouse-=a - " copy/paste to system clipboard - set clipboard=unnamedplus - " completion menu settings - set wildmenu - set wildmode=longest,list,full - " highlight all matching searches (using / and ?) - set hlsearch - " allow backspace to delete empty lines in insert mode - set backspace=indent,eol,start - " built-in syntax highlighting - syntax enable - " show line/col number in bottom right - set ruler - " highlight trailing space & related syntax errors (does this work?) - let c_space_errors=1 - let python_space_errors=1 - ''; - }; - - home.packages = [ - pkgs.btrfs-progs - pkgs.gnumake - pkgs.dig - pkgs.duplicity - pkgs.fatresize - pkgs.fd - pkgs.file - pkgs.gptfdisk - pkgs.hdparm - pkgs.htop - pkgs.iftop - pkgs.iotop - pkgs.iptables - pkgs.jq - pkgs.killall - pkgs.lm_sensors # for sensors-detect - pkgs.lsof - pkgs.pciutils - pkgs.mix2nix - pkgs.netcat - pkgs.nixUnstable - # pkgs.nettools - pkgs.nmap - pkgs.parted - pkgs.powertop - pkgs.python3 - pkgs.ripgrep - pkgs.smartmontools - pkgs.snapper - pkgs.socat - pkgs.sudo - pkgs.telnet - pkgs.usbutils - pkgs.vulnix - pkgs.wireguard - pkgs.zola - - pkgs.matrix-synapse - - # graphical - # pkgs.clinfo - # pkgs.discord - # pkgs.element-desktop - # pkgs.gnome.dconf-editor - # pkgs.mesa-demos - # pkgs.tdesktop - ]; -} diff --git a/machines/uninsane/default.nix b/machines/uninsane/default.nix index 87f2ad42..2ebbaf31 100644 --- a/machines/uninsane/default.nix +++ b/machines/uninsane/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ pkgs, lib, ... }: { imports = [ @@ -19,7 +19,12 @@ ./services/transmission.nix ]; - home-manager.users.colin.imports = [ ./colin.nix ]; + home-manager.users.colin = import ../../helpers/home-manager-gen-colin.nix { + inherit pkgs lib; + system = "aarch64-linux"; + gui = null; + extraPackages = [ pkgs.matrix-synapse ]; + }; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions