refactor: big refactor

main
Ricard Illa 2023-08-13 12:30:14 +02:00
parent 79e3c5c266
commit 6ab585ff13
Signed by: rilla
GPG Key ID: 525307BD467E4205
116 changed files with 325 additions and 406 deletions

View File

@ -25,36 +25,23 @@
in in
rec { rec {
overlays = import ./overlays { inherit inputs; }; overlays = import ./overlays { inherit inputs; };
nixosModules = import ./modules/nixos;
homeManagerModules = import ./modules/home-manager;
stablePkgs = nixpkgs-stable.legacyPackages."x86_64-linux";
nixosConfigurations = { nixosConfigurations = {
trantor = nixpkgs.lib.nixosSystem { trantor = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
# unstablePkgs = nixpkgs-unstable.legacyPackages."x86_64-linux";
stablePkgs = nixpkgs-stable.legacyPackages."x86_64-linux";
impermanence = impermanence;
};
modules = [ modules = [
./nixos/hosts/trantor ./hosts/trantor
./nixos/modules/common.nix
./nixos/modules/desktop.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
impermanence.nixosModules.impermanence impermanence.nixosModules.impermanence
]; ];
}; };
capibara = nixpkgs.lib.nixosSystem { capibara = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; specialArgs = { inherit stablePkgs impermanence inputs outputs; };
specialArgs = {
stablePkgs = nixpkgs-stable.legacyPackages."x86_64-linux";
impermanence = impermanence;
};
modules = [ modules = [
./nixos/hosts/capibara ./hosts/capibara
./nixos/modules/common.nix
./nixos/modules/desktop.nix
nixos-hardware.nixosModules.lenovo-thinkpad-x230 nixos-hardware.nixosModules.lenovo-thinkpad-x230
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
impermanence.nixosModules.impermanence impermanence.nixosModules.impermanence
@ -64,33 +51,12 @@
homeConfigurations = { homeConfigurations = {
"rilla@capibara" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; };
modules = [
./home/hosts/capibara.nix
./home/modules/common
./home/modules/desktop-river
./home/modules/theming
];
};
"rilla@trantor" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; };
modules = [
./home/hosts/trantor.nix
./home/modules/common
./home/modules/desktop-river
./home/modules/theming/trantor.nix
];
};
"rilla@echidna" = home-manager.lib.homeManagerConfiguration { "rilla@echidna" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; }; extraSpecialArgs = { inherit inputs outputs; };
modules = [ ./home/hosts/echidna.nix ]; modules = [ ./hosts/echidna/home.nix ];
}; };
}; };
}; };
} }

View File

@ -1,4 +0,0 @@
{ inputs, outputs, lib, config, pkgs, ... }:
{
}

View File

@ -1,90 +0,0 @@
{ config, pkgs, ... }:
{
home.username = "rilla";
home.homeDirectory = "/home/rilla";
home.stateVersion = "23.05";
programs.home-manager.enable = true;
nixpkgs.config = { allowUnfree = true; };
imports = [
../modules/cheat
../modules/foot
../modules/dav
../modules/fonts
../modules/git
../modules/gpg
../modules/lf
../modules/mail
../modules/neovim
../modules/pass
../modules/rss
../modules/ssh
../modules/tmux
../modules/vitetris
../modules/xdg
../modules/zsh
];
home.sessionVariables = {
EDITOR = "${pkgs.neovim}/bin/nvim";
VISUAL = "${pkgs.neovim}/bin/nvim";
BROWSER = "${pkgs.firefox}/bin/firefox";
# OPENER = "todo"; # todo
TERMINAL = "${pkgs.alacritty}/bin/alacritty";
CM_LAUNCHER = "rofi"; # for clipmenu
LEDGER_FILE = "${config.home.homeDirectory}/finance/2021.journal";
};
home.packages = with pkgs; [
R
ansible
bind.dnsutils
docker-compose
file
just
gnumake
html-tidy
htop
inetutils # telnet
j2cli
jq
killall
kubectl
libnotify
mosh
neofetch
pandoc
podman-compose
pv
ripgrep
sassc
screen
shellcheck
signify
unzip
wget
];
programs.bat = {
enable = true;
config = { theme = "gruvbox-dark"; };
};
programs.fzf = {
enable = true;
enableZshIntegration = true;
# defaultOptions = [
# "--preview --preview 'bat --color=always --style=header,grid --line-range :300 {}'"
# ];
tmux.enableShellIntegration = true;
};
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
}

View File

@ -1,9 +0,0 @@
{ config, pkgs, ... }:
{
imports = [
./common.nix
../modules/desktop-river
../modules/theming/trantor.nix
];
}

View File

@ -1,12 +0,0 @@
{ config, pkgs, ... }:
{
# imports = [ ./firefox ];
home.packages = [ pkgs.librewolf pkgs.firefox pkgs.tor-browser-bundle-bin ];
programs.chromium = {
enable = true;
package = pkgs.ungoogled-chromium;
};
}

View File

@ -1,61 +0,0 @@
{ config, pkgs, ... }:
{
# nix-env -f '<nixpkgs>' -qaP -A nur.repos.rycee.firefox-addons
programs.firefox = {
enable = true;
# maybe enable tridactyl?
# nix-env -f '<nixpkgs>' -qaP -A nur.repos.rycee.firefox-addons
# extensions = with pkgs.nur.repos.rycee.firefox-addons; [
# browserpass
# canvasblocker
# clearurls
# cookie-autodelete
# darkreader
# floccus
# foxyproxy-standard
# https-everywhere
# i-dont-care-about-cookies
# localcdn
# noscript
# privacy-possum
# privacy-redirect
# ublock-origin
# vimium
# # todo: AdNauseam, wallabagger, DownThemAll! Wayback Machine
# ];
profiles = {
default = {
id = 0;
name = "default";
isDefault = true;
settings = {
# change some values from arkenfox's defaults
"privacy.resistFingerprinting" =
false; # if true, this would the window size to rounded dimensions, which is too annoying on a tiling window manager
"extensions.pocket.enabled" = false;
"identity.fxaccounts.enabled" = false;
"browser.search.suggest.enabled" = true;
"browser.urlbar.suggest.searches" = true;
"keyword.enable" = true;
# for Firefox-UI-Fix
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"browser.proton.enabled" = true;
"svg.context-properties.content.enabled" = true;
"layout.css.backdrop-filter.enabled" = true;
"browser.compactmode.show" = true;
"browser.urlbar.suggest.calculator" = true;
"browser.uidensity" = 1;
# "browser.search.region" = "GB";
# "browser.search.isUS" = false;
# "distribution.searchplugins.defaultLocale" = "en-GB";
# "general.useragent.locale" = "en-GB";
# "browser.bookmarks.showMobileBookmarks" = true;
};
};
};
};
}

View File

@ -1,147 +0,0 @@
{ inputs, outputs, lib, config, pkgs, ... }:
{
nixpkgs = {
overlays = [
outputs.overlays.modifications
];
config = {
allowUnfree = true;
allowUnfreePredicate = (_: true);
};
};
home = {
username = "rilla";
homeDirectory = "/home/rilla";
};
programs.home-manager.enable = true;
imports = [
# ./minidisc
../arduino
../browsers
../cheat
../dav
../drawterm
../fonts
../foot
../git
../gotify
../gpg
../idasen
../lf
../mail
../maker
../mpd
../msg
../music
../neovim
../pass
../rss
../snapcast
../sound
../ssh
../syncthing
../tmux
../vitetris
../wallets
../wine
../xdg
../zsh
];
home.sessionVariables = {
BROWSER = "${pkgs.firefox}/bin/firefox";
TERMINAL = "${pkgs.alacritty}/bin/alacritty";
};
home.packages = with pkgs; [
# calibre
R
acpi
android-tools
ansible
bind.dnsutils
# pyenv
docker-compose
file
gimp
gnumake
html-tidy
htop
inetutils # telnet
j2cli
john
jq
killall
kubectl
libnotify
libreoffice
lxqt.pcmanfm-qt
mosh
mpv
neofetch
pynitrokey
networkmanagerapplet
nextcloud-client
pandoc
podman-compose
pv
ripgrep
sassc
screen
shellcheck
signify
unzip
vagrant
virt-manager
virtiofsd
wget
];
# services.kdeconnect = {
# enable = true;
# indicator = true;
# };
programs.bat = {
enable = true;
config = { theme = "gruvbox-dark"; };
};
programs.fzf = {
enable = true;
enableZshIntegration = true;
# defaultOptions = [
# "--preview --preview 'bat --color=always --style=header,grid --line-range :300 {}'"
# ];
tmux.enableShellIntegration = true;
};
services.gnome-keyring = {
enable = true;
components = [ "secrets" ];
};
services.nextcloud-client = {
enable = true;
startInBackground = true;
};
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
"autoconnect" = [ "qemu:///system" ];
"uris" = [ "qemu:///system" ];
};
};
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
home.stateVersion = "22.11";
}

View File

@ -1,32 +1,18 @@
{ config, pkgs, ... }: { inputs, outputs, config, pkgs, ... }:
let
offline-backups = pkgs.writeScriptBin "offline-backups" ''
#!${pkgs.dash}/bin/dash
set -xe
for x in 0 1 2; do
${pkgs.systemd}/bin/systemctl start "mnt-backups-''${x}.mount"
done && \
/run/wrappers/bin/doas -u btrbk \
${pkgs.btrbk}/bin/btrbk \
--config /etc/btrbk/offline-backups.conf \
--progress \
--verbose \
"$@"
'';
in
{ {
nixpkgs.hostPlatform = "x86_64-linux";
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./file-systems.nix ./file-systems.nix
./home-manager.nix
outputs.nixosModules.common
outputs.nixosModules.desktop
]; ];
networking.networkmanager.wifi.macAddress = "CC:AF:78:75:29:32"; networking.networkmanager.wifi.macAddress = "CC:AF:78:75:29:32";
nixpkgs.config.allowUnfree = true;
programs.steam.enable = true; programs.steam.enable = true;
@ -38,7 +24,7 @@ in
# services.thermald.enable = true; # services.thermald.enable = true;
services.tlp.enable = true; services.tlp.enable = true;
services.power-profiles-daemon.enable = false; services.power-profiles-daemon.enable = false;
environment.systemPackages = with pkgs; [ powertop acpi offline-backups ]; environment.systemPackages = with pkgs; [ powertop acpi ];
# todo: target and/or archive # todo: target and/or archive
services.btrbk.instances = { services.btrbk.instances = {

View File

@ -0,0 +1,19 @@
{ inputs, outputs, config, pkgs, ... }:
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit inputs outputs; };
users.rilla = {
home = {
packages = [ pkgs.offline-backups ];
stateVersion = "22.11";
};
imports = [
outputs.homeManagerModules.common
outputs.homeManagerModules.extra
];
};
};
}

18
hosts/echidna/home.nix Normal file
View File

@ -0,0 +1,18 @@
{ inputs, outputs, config, pkgs, ... }:
{
nixpkgs = {
overlays = [
outputs.overlays.additions
outputs.overlays.modifications
];
config = {
allowUnfree = true;
allowUnfreePredicate = (_: true);
};
};
imports = [ outputs.homeManagerModules.common ];
home.stateVersion = "23.05";
}

View File

@ -1,18 +1,18 @@
{ config, pkgs, ... }: { inputs, outputs, config, pkgs, ... }:
{ {
nixpkgs.hostPlatform = "x86_64-linux";
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./file-systems.nix ./file-systems.nix
]; ./home-manager.nix
outputs.nixosModules.common
home-manager.users.rilla.imports = [ outputs.nixosModules.desktop
../../../home/hosts/trantor.nix
]; ];
networking.networkmanager.wifi.macAddress = "80:FA:5B:41:12:0F"; networking.networkmanager.wifi.macAddress = "80:FA:5B:41:12:0F";
nixpkgs.config.allowUnfree = true;
programs.steam.enable = true; programs.steam.enable = true;
# todo: target and/or archive # todo: target and/or archive

View File

@ -1,6 +1,3 @@
# 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, ... }: { config, lib, pkgs, modulesPath, ... }:
{ {

View File

@ -0,0 +1,20 @@
{ inputs, outputs, config, pkgs, ... }:
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit inputs outputs; };
users.rilla = {
home = {
packages = [ pkgs.offline-backups ];
stateVersion = "22.11";
};
imports = [
outputs.homeManagerModules.common
outputs.homeManagerModules.extra
];
};
};
}

View File

@ -2,9 +2,7 @@ echidna:
home-manager switch --flake .#rilla@echidna home-manager switch --flake .#rilla@echidna
capibara: capibara:
doas nixos-rebuild switch --flake .#capibara && \ doas nixos-rebuild switch --flake .#capibara
home-manager switch --flake .#rilla@capibara
trantor: trantor:
doas nixos-rebuild switch --flake .#trantor && \ doas nixos-rebuild switch --flake .#trantor
home-manager switch --flake .#rilla@trantor

View File

@ -0,0 +1,13 @@
{ config, pkgs, ... }:
{
home.packages = [ pkgs.librewolf pkgs.tor-browser-bundle-bin ];
programs.firefox.enable = true;
home.sessionVariables.BROWSER = "${pkgs.firefox}/bin/firefox";
programs.chromium = {
enable = true;
package = pkgs.ungoogled-chromium;
};
}

View File

@ -0,0 +1,78 @@
# common
{ inputs, outputs, lib, config, pkgs, ... }:
{
home = {
username = "rilla";
homeDirectory = "/home/rilla";
};
programs.home-manager.enable = true;
imports = [
../cheat
../dav
../fonts
../foot
../git
../gpg
../lf
../mail
../neovim
../pass
../rss
../ssh
../tmux
../vitetris
../xdg
../zsh
];
home.packages = with pkgs; [
R
ansible
bind.dnsutils
docker-compose
file
just
gnumake
html-tidy
htop
inetutils # telnet
j2cli
jq
killall
kubectl
libnotify
mosh
neofetch
pandoc
podman-compose
pv
ripgrep
sassc
screen
shellcheck
signify
unzip
wget
];
programs.bat = {
enable = true;
config = { theme = "gruvbox-dark"; };
};
programs.fzf = {
enable = true;
enableZshIntegration = true;
tmux.enableShellIntegration = true;
};
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
}

View File

@ -0,0 +1,43 @@
{
common = import ./common;
extra = import ./extra;
alacritty = import ./alacritty;
arduino = import ./arduino;
barrier = import ./barrier;
browsers = import ./browsers;
cheat = import ./cheat;
dav = import ./dav;
default.txt = import ./default.txt;
desktop-river = import ./desktop-river;
desktop-xmonad = import ./desktop-xmonad;
drawterm = import ./drawterm;
fonts = import ./fonts;
foot = import ./foot;
gcloud = import ./gcloud;
git = import ./git;
gotify = import ./gotify;
gpg = import ./gpg;
idasen = import ./idasen;
lf = import ./lf;
mail = import ./mail;
maker = import ./maker;
minidisc = import ./minidisc;
mpd = import ./mpd;
msg = import ./msg;
music = import ./music;
neovim = import ./neovim;
pass = import ./pass;
rss = import ./rss;
snapcast = import ./snapcast;
sound = import ./sound;
ssh = import ./ssh;
syncthing = import ./syncthing;
theming = import ./theming;
tmux = import ./tmux;
vitetris = import ./vitetris;
wallets = import ./wallets;
wine = import ./wine;
xdg = import ./xdg;
zsh = import ./zsh;
}

View File

@ -0,0 +1,67 @@
# extra
{ inputs, outputs, lib, config, pkgs, ... }:
{
imports = [
# ./minidisc
../arduino
../browsers
../desktop-river
../drawterm
../gotify
../idasen
../maker
../mpd
../msg
../music
../snapcast
../sound
../syncthing
../theming
../wallets
../wine
];
home.packages = with pkgs; [
# calibre
acpi
android-tools
# pyenv
gimp
john
libreoffice
lxqt.pcmanfm-qt
mpv
pynitrokey
networkmanagerapplet
nextcloud-client
vagrant
virt-manager
virtiofsd
];
# services.kdeconnect = {
# enable = true;
# indicator = true;
# };
services.gnome-keyring = {
enable = true;
components = [ "secrets" ];
};
services.nextcloud-client = {
enable = true;
startInBackground = true;
};
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
"autoconnect" = [ "qemu:///system" ];
"uris" = [ "qemu:///system" ];
};
};
}

View File

@ -44,4 +44,5 @@ in
}; };
}; };
home.sessionVariables.TERMINAL = "${pkgs.foot}/bin/foot";
} }

Some files were not shown because too many files have changed in this diff Show More