Restructure home management

- Home config is now imported as a module from the host config
- The configuration takes variables to decide which settings to activate
- Extra fonts were added
- Some packages were added/reactivated
This commit is contained in:
Oystein Kristoffer Tveit 2022-04-03 18:03:55 +02:00
parent fbaf7caeb6
commit cad1f6abe5
8 changed files with 358 additions and 463 deletions

34
flake.lock generated
View File

@ -31,6 +31,18 @@
"type": "github" "type": "github"
} }
}, },
"fonts": {
"flake": false,
"locked": {
"narHash": "sha256-bkloNC5QJvk/7u6YaPFzQ7uZJzO280lFZZ09iRvQUtY=",
"path": "/home/h7x4/git/fonts",
"type": "path"
},
"original": {
"path": "/home/h7x4/git/fonts",
"type": "path"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -54,11 +66,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1647820583, "lastModified": 1648203577,
"narHash": "sha256-2awN2f/dXpVvms6zo2e4TBaZDtQNucMrruqNPIvb518=", "narHash": "sha256-CbXZkiVTA0ByV/yncFHCAGIa/AfcSb0cjqzEa56rO+Y=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "01e87b327aa89d9d60fba192085bccddaa2d1b24", "rev": "d89f18a17e51532ed5f4d45297b0ddf11e46b9c8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -70,6 +82,7 @@
"root": { "root": {
"inputs": { "inputs": {
"dotfiles": "dotfiles", "dotfiles": "dotfiles",
"fonts": "fonts",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"secrets": "secrets", "secrets": "secrets",
@ -83,8 +96,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1647911882, "lastModified": 1648431323,
"narHash": "sha256-4bwjEIgkbF9/G0MP69iV03OLU3V+GzKGKcKvzhdg8Jk=", "narHash": "sha256-QfEh/IY3RodDhwt9ij4gzdU4cgQ/Ejk45PZMM1sNkoM=",
"ref": "main",
"rev": "d9728ee32a078ca67af897d951db007391857daa",
"revCount": 21,
"type": "git", "type": "git",
"url": "file:///home/h7x4/git/nix-secrets" "url": "file:///home/h7x4/git/nix-secrets"
}, },
@ -101,11 +117,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1647647976, "lastModified": 1648430064,
"narHash": "sha256-rFEloIIRTB43w4/ox9/6H+zpXu0zEEW7Ri3pmx/o35A=", "narHash": "sha256-kPRmFqlTWPrlyaVkOm/dWbui2EDzaCmwjwBRv3nciSw=",
"ref": "main", "ref": "main",
"rev": "1030977dfd0c861e186b3b142cbb161feaa0c32e", "rev": "9fc1893ad33ae78c30f81b6438bf1bd5097a1ae3",
"revCount": 51, "revCount": 61,
"type": "git", "type": "git",
"url": "https://git.nani.wtf/h7x4/nani.wtf" "url": "https://git.nani.wtf/h7x4/nani.wtf"
}, },

View File

@ -8,12 +8,17 @@
url = "github:nix-community/home-manager/release-21.11"; url = "github:nix-community/home-manager/release-21.11";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
dotfiles = { dotfiles = {
url = "github:h7x4abk3g/dotfiles"; url = "github:h7x4abk3g/dotfiles";
flake = false; flake = false;
}; };
fonts = {
url = "path:/home/h7x4/git/fonts";
flake = false;
};
website = { website = {
url = "git+https://git.nani.wtf/h7x4/nani.wtf?ref=main"; url = "git+https://git.nani.wtf/h7x4/nani.wtf?ref=main";
# url = "path:/home/h7x4/git/nani.wtf"; # url = "path:/home/h7x4/git/nani.wtf";
@ -36,6 +41,7 @@
nixpkgs, nixpkgs,
home-manager, home-manager,
secrets, secrets,
fonts,
dotfiles, dotfiles,
website, website,
... ...
@ -50,15 +56,17 @@
android_sdk.accept_license = true; android_sdk.accept_license = true;
}; };
overlays = [ (import ./overlays/lib) ]; overlays = [ self.overlays.lib ];
}; };
specialArgs = { specialArgs = {
secrets = secrets.outputs.default; secrets = secrets.outputs.default;
colorTheme = import ./common/colors.nix; colorTheme = import ./common/colors.nix;
inputs = { inputs = {
inherit self;
inherit home-manager; inherit home-manager;
inherit dotfiles; inherit dotfiles;
inherit fonts;
inherit website; inherit website;
inherit secrets; inherit secrets;
}; };
@ -69,12 +77,22 @@
lib = import ./overlays/lib; lib = import ./overlays/lib;
}; };
lib = (pkgs.extend self.overlays.lib).lib;
homeConfigurations = { homeConfigurations = {
h7x4 = home-manager.lib.homeManagerConfiguration { h7x4 = home-manager.lib.homeManagerConfiguration {
inherit system; inherit system;
inherit pkgs; inherit pkgs;
extraSpecialArgs = specialArgs; extraSpecialArgs = specialArgs // {
machineVars = {
hostname = "machine";
headless = false;
screens = 1;
gaming = true;
laptop = false;
};
};
username = "h7x4"; username = "h7x4";
homeDirectory = "/home/h7x4"; homeDirectory = "/home/h7x4";
stateVersion = "21.11"; stateVersion = "21.11";
@ -89,25 +107,42 @@
}; };
nixosConfigurations = let nixosConfigurations = let
# String -> AttrSet -> AttrSet # String -> AttrSet -> AttrSet
nixSys = nixSys = name: extraOpts: machineVars:
name: extraOpts:
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
inherit system; inherit system;
inherit pkgs; inherit pkgs;
inherit (pkgs) lib;
lib = pkgs.lib; specialArgs = specialArgs // { inherit machineVars; };
inherit specialArgs;
modules = [ modules = [
"${home-manager}/nixos"
./hosts/common.nix
./hosts/${name}/configuration.nix ./hosts/${name}/configuration.nix
]; ];
} // extraOpts; } // extraOpts;
in { in {
Tsuki = nixSys "tsuki" {}; Tsuki = nixSys "tsuki" {} {
Eisei = nixSys "eisei" {}; hostname = "tsuki";
kasei = nixSys "kasei" {}; headless = true;
gaming = false;
laptop = false;
};
Eisei = nixSys "eisei" {} {
hostname = "eisei";
headless = false;
screens = 1;
gaming = false;
laptop = true;
};
kasei = nixSys "kasei" {} {
hostname = "kasei";
headless = false;
screens = 2;
gaming = true;
laptop = false;
};
}; };
}; };

View File

@ -1,28 +1,34 @@
{ pkgs, ... } @ args: { pkgs, machineVars, ... } @ args: let
{ inherit (pkgs) lib;
inherit (pkgs.lib) mkForce mkIf optionals;
graphics = !machineVars.headless;
in {
imports = [ imports = [
./shellOptions.nix ./shellOptions.nix
./packages.nix ./packages.nix
./misc/mimetypes.nix
./misc/ssh/hosts/pvv.nix ./misc/ssh/hosts/pvv.nix
./programs/alacritty.nix
./programs/comma.nix ./programs/comma.nix
./programs/emacs
./programs/gh.nix ./programs/gh.nix
./programs/git.nix ./programs/git.nix
./programs/ncmpcpp.nix
./programs/neovim.nix ./programs/neovim.nix
./programs/newsboat.nix ./programs/newsboat.nix
./programs/tmux.nix
./programs/zsh
] ++ optionals graphics [
./misc/mimetypes.nix
./programs/alacritty.nix
./programs/emacs
./programs/ncmpcpp.nix
./programs/qutebrowser.nix ./programs/qutebrowser.nix
./programs/rofi.nix ./programs/rofi.nix
./programs/tmux.nix
./programs/vscode.nix ./programs/vscode.nix
./programs/xmobar ./programs/xmobar
./programs/xmonad ./programs/xmonad
./programs/zathura.nix ./programs/zathura.nix
./programs/zsh
./services/dunst.nix ./services/dunst.nix
./services/mpd.nix ./services/mpd.nix
@ -35,11 +41,26 @@
stateVersion = "21.11"; stateVersion = "21.11";
username = "h7x4"; username = "h7x4";
homeDirectory = "/home/h7x4"; homeDirectory = "/home/h7x4";
file = {
".ghci".text = ''
:set prompt "${lib.termColors.front.magenta "[GHCi]λ"} ".
'';
".pyrc".text = ''
#!/usr/bin/env python3
import sys
# You also need \x01 and \x02 to separate escape sequence, due to:
# https://stackoverflow.com/a/9468954/1147688
sys.ps1='\x01\x1b${lib.termColors.front.blue "[Python]> "}\x02>>>\x01\x1b[0m\x02 ' # bright yellow
sys.ps2='\x01\x1b[1;49;31m\x02...\x01\x1b[0m\x02 ' # bright red
'';
};
}; };
news.display = "silent"; news.display = "silent";
fonts.fontconfig.enable = true; fonts.fontconfig.enable = mkForce true;
programs = { programs = {
home-manager.enable = true; home-manager.enable = true;
@ -47,7 +68,7 @@
bat.enable = true; bat.enable = true;
bottom.enable = true; bottom.enable = true;
exa.enable = true; exa.enable = true;
feh.enable = true; feh.enable = mkIf graphics true;
fzf = { fzf = {
enable = true; enable = true;
defaultCommand = "fd --type f"; defaultCommand = "fd --type f";
@ -60,8 +81,8 @@
enable = true; enable = true;
generateCaches = true; generateCaches = true;
}; };
mpv.enable = true; mpv.enable = mkIf graphics true;
obs-studio.enable = true; obs-studio.enable = mkIf graphics true;
ssh.enable = true; ssh.enable = true;
skim = { skim = {
enable = true; enable = true;
@ -71,14 +92,13 @@
enable = true; enable = true;
# packageSet = pkgs.texlive.combined.scheme-medium; # packageSet = pkgs.texlive.combined.scheme-medium;
}; };
# xmobar.enable = true;
zoxide.enable = true; zoxide.enable = true;
}; };
services = { services = {
gnome-keyring.enable = true; gnome-keyring.enable = mkIf graphics true;
dropbox.enable = true; dropbox.enable = true;
network-manager-applet.enable = true; network-manager-applet.enable = mkIf graphics true;
# redshift.enable = true; # redshift.enable = true;
}; };
@ -88,7 +108,17 @@
json.enable = true; json.enable = true;
}; };
gtk = { xdg.enable = true;
xsession = mkIf graphics {
pointerCursor = {
package = pkgs.capitaine-cursors;
name = "capitaine-cursors";
size = 16;
};
};
gtk = mkIf graphics {
enable = true; enable = true;
font = { font = {
name = "Droid Sans"; name = "Droid Sans";
@ -103,7 +133,7 @@
}; };
}; };
qt = { qt = mkIf graphics {
enable = true; enable = true;
platformTheme = "gtk"; platformTheme = "gtk";
style = { style = {
@ -111,14 +141,4 @@
package = pkgs.adwaita-qt; package = pkgs.adwaita-qt;
}; };
}; };
xdg.enable = true;
xsession = {
pointerCursor = {
package = pkgs.capitaine-cursors;
name = "capitaine-cursors";
size = 16;
};
};
} }

126
hosts/common.nix Normal file
View File

@ -0,0 +1,126 @@
{ pkgs, config, inputs, specialArgs, ... }:
let
inherit (pkgs) lib;
in {
time.timeZone = "Europe/Oslo";
i18n.defaultLocale = "en_US.UTF-8";
# nixpkgs.config = {
# allowUnfree = true;
# };
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
nix = {
package = pkgs.nixFlakes;
extraOptions = ''
experimental-features = nix-command flakes
builders-use-substitutes = true
'';
};
environment = {
variables = {
EDITOR = "nvim";
VISUAL = "nvim";
};
shells = with pkgs; [
bashInteractive
zsh
dash
];
etc = {
# TODO: move this out of etc, and reference it directly in sudo config.
sudoLecture = {
target = "sudo.lecture";
text = lib.termColors.front.red "Be careful or something, idk...\n";
};
"resolv.conf".source = let
inherit (lib.strings) concatStringsSep;
inherit (pkgs) writeText;
in writeText "resolv.conf" ''
${concatStringsSep "\n" (map (ns: "nameserver ${ns}") config.networking.nameservers)}
options edns0
'';
currentSystemPackages = {
target = "current-system-packages";
text = let
inherit (lib.strings) concatStringsSep;
inherit (lib.lists) sort;
inherit (lib.trivial) lessThan;
packages = map (p: "${p.name}") config.environment.systemPackages;
sortedUnique = sort lessThan (lib.unique packages);
in concatStringsSep "\n" sortedUnique;
};
};
};
fonts = {
enableDefaultFonts = true;
fonts = with pkgs; [
cm_unicode
dejavu_fonts
fira-code
fira-code-symbols
powerline-fonts
iosevka
symbola
corefonts
ipaexfont
ipafont
liberation_ttf
migmix
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
open-sans
source-han-sans
source-sans
ubuntu_font_family
victor-mono
(nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ]; })
inputs.fonts
];
fontconfig = {
defaultFonts = {
serif = [ "Droid Sans Serif" "Ubuntu" ];
sansSerif = [ "Droid Sans" "Ubuntu" ];
monospace = [ "Fira Code" "Ubuntu" ];
emoji = [ "Noto Sans Emoji" ];
};
};
};
users.users.h7x4 = {
isNormalUser = true;
shell = pkgs.zsh;
};
home-manager = {
useGlobalPkgs = true;
extraSpecialArgs = specialArgs;
# TODO: figure out why specialArgs isn't accessible from the root home file.
users.h7x4 = import ../home.nix {
inherit pkgs;
inherit (specialArgs) machineVars;
};
};
security.sudo.extraConfig = ''
Defaults lecture = always
Defaults lecture_file = /etc/${config.environment.etc.sudoLecture.target}
'';
system.stateVersion = "21.11";
}

View File

@ -25,8 +25,6 @@ in {
}; };
}; };
time.timeZone = "Europe/Oslo";
networking = { networking = {
hostName = "Eisei"; hostName = "Eisei";
networkmanager.enable = true; networkmanager.enable = true;
@ -45,8 +43,6 @@ in {
}; };
i18n = { i18n = {
defaultLocale = "en_US.UTF-8";
inputMethod = { inputMethod = {
enabled = "fcitx"; enabled = "fcitx";
fcitx.engines = with pkgs.fcitx-engines; [ mozc ]; fcitx.engines = with pkgs.fcitx-engines; [ mozc ];
@ -61,11 +57,6 @@ in {
# }; # };
}; };
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
services = { services = {
openssh.enable = true; openssh.enable = true;
gnome.gnome-keyring.enable = true; gnome.gnome-keyring.enable = true;
@ -106,20 +97,11 @@ in {
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
nixpkgs.config = {
allowUnfree = true;
};
nix = { nix = {
distributedBuilds = true; distributedBuilds = true;
package = pkgs.nixFlakes;
binaryCaches = [ binaryCaches = [
"https://cache.nixos.org/" "https://cache.nixos.org/"
]; ];
extraOptions = ''
experimental-features = nix-command flakes
builders-use-substitutes = true
'';
buildMachines = [ buildMachines = [
{ {
@ -139,94 +121,21 @@ in {
}; };
users.users.h7x4 = { users.users.h7x4.extraGroups = [
isNormalUser = true; "wheel"
extraGroups = [ "networkmanager"
"wheel" "docker"
"networkmanager" "disk"
"docker" "audio"
"disk" "video"
"audio" "libvirtd"
"video" "input"
"libvirtd" ];
"input"
];
shell = pkgs.zsh;
};
environment = { environment.systemPackages = with pkgs; [
variables = { wget
EDITOR = "nvim"; haskellPackages.xmobar
VISUAL = "nvim"; ];
};
systemPackages = with pkgs; [
wget
haskellPackages.xmobar
];
shells = with pkgs; [
bashInteractive
zsh
dash
];
etc = {
# TODO: move this out of etc, and reference it directly in sudo config.
sudoLecture = {
target = "sudo.lecture";
text = lib.termColors.front.red "Be careful or something, idk...\n";
};
currentSystemPackages = {
target = "current-system-packages";
text = let
inherit (lib.strings) concatStringsSep;
inherit (lib.lists) sort;
inherit (lib.trivial) lessThan;
packages = map (p: "${p.name}") config.environment.systemPackages;
sortedUnique = sort lessThan (lib.unique packages);
in concatStringsSep "\n" sortedUnique;
};
};
};
fonts = {
enableDefaultFonts = true;
fonts = with pkgs; [
cm_unicode
dejavu_fonts
fira-code
fira-code-symbols
powerline-fonts
iosevka
symbola
corefonts
ipaexfont
ipafont
liberation_ttf
migmix
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
open-sans
source-han-sans
source-sans
ubuntu_font_family
victor-mono
(nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ]; })
];
fontconfig = {
defaultFonts = {
serif = [ "Droid Sans Serif" "Ubuntu" ];
sansSerif = [ "Droid Sans" "Ubuntu" ];
monospace = [ "Fira Code" "Ubuntu" ];
emoji = [ "Noto Sans Emoji" ];
};
};
};
programs = { programs = {
dconf.enable = true; dconf.enable = true;
@ -269,16 +178,9 @@ in {
}; };
}; };
security.sudo.extraConfig = ''
Defaults lecture = always
Defaults lecture_file = /etc/${config.environment.etc.sudoLecture.target}
'';
virtualisation = { virtualisation = {
docker.enable = true; docker.enable = true;
libvirtd.enable = true; libvirtd.enable = true;
}; };
system.stateVersion = "21.11";
} }

View File

@ -1,11 +1,9 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, inputs, specialArgs, ... }:
{ {
imports = imports = [
[ ./hardware-configuration.nix
./hardware-configuration.nix ../../pluggables/tools/programming.nix
];
../../pluggables/tools/programming.nix
];
systemd.targets = { systemd.targets = {
sleep.enable = false; sleep.enable = false;
@ -14,14 +12,10 @@
hybrid-sleep.enable = false; hybrid-sleep.enable = false;
}; };
nix.package = pkgs.nixFlakes;
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
# security.pam.services.login.unixAuth = true; # security.pam.services.login.unixAuth = true;
boot.loader = { boot.loader = {
efi.canTouchEfiVariables = false;
grub = { grub = {
enable = true; enable = true;
version = 2; version = 2;
@ -30,12 +24,8 @@
device = "nodev"; device = "nodev";
efiInstallAsRemovable = true; efiInstallAsRemovable = true;
}; };
# efi.efiSysMountPoint = "/boot/efi";
# efi.canTouchEfiVariables = true;
}; };
time.timeZone = "Europe/Oslo";
networking = { networking = {
hostName = "kasei"; hostName = "kasei";
networkmanager.enable = true; networkmanager.enable = true;
@ -50,8 +40,6 @@
}; };
i18n = { i18n = {
defaultLocale = "en_US.UTF-8";
inputMethod = { inputMethod = {
enabled = "fcitx"; enabled = "fcitx";
fcitx.engines = with pkgs.fcitx-engines; [ mozc ]; fcitx.engines = with pkgs.fcitx-engines; [ mozc ];
@ -65,126 +53,36 @@
# ]; # ];
# }; # };
}; };
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
# services = { users.users.h7x4.extraGroups = [
# openssh = { "wheel"
# enable = true; "networkmanager"
# passwordAuthentication = false; "docker"
# challengeResponseAuthentication = false; "audio"
# permitRootLogin = "no"; "video"
# }; "disk"
# printing.enable = true; "libvirtd"
# cron = { "input"
# enable = true; ];
# systemCronJobs = [
# # "*/5 * * * * root date >> /tmp/cron.log"
# ];
# };
# };
users.users = {
h7x4 = {
isNormalUser = true;
extraGroups = [
"wheel"
"networkmanager"
"docker"
"audio"
"video"
"disk"
"libvirtd"
"input"
];
shell = pkgs.zsh;
};
};
environment = { environment = {
variables = { shellAliases = {
EDITOR = "nvim"; fixscreen = "xrandr --output DP-4 --mode 1920x1080 --pos 0x0 -r 144 --output DVI-D-1 --primary --mode 1920x1080 --pos 1920x0 -r 60";
VISUAL = "nvim";
}; };
systemPackages = with pkgs; [ systemPackages = with pkgs; [
wget wget
haskellPackages.xmobar haskellPackages.xmobar
]; ];
shells = with pkgs; [
bashInteractive
zsh
dash
];
etc = {
sudoLecture = {
target = "sudo.lecture";
text = "Be careful or something, idk...\n";
};
"resolv.conf" = with lib; with pkgs; {
source = writeText "resolv.conf" ''
${concatStringsSep "\n" (map (ns: "nameserver ${ns}") config.networking.nameservers)}
options edns0
'';
};
currentSystemPackages = {
target = "current-system-packages";
text = let
inherit (lib.strings) concatStringsSep;
inherit (lib.lists) sort;
inherit (lib.trivial) lessThan;
packages = map (p: "${p.name}") config.environment.systemPackages;
sortedUnique = sort lessThan (lib.unique packages);
in concatStringsSep "\n" sortedUnique;
};
};
};
fonts = {
enableDefaultFonts = true;
fonts = with pkgs; [
cm_unicode
dejavu_fonts
fira-code
fira-code-symbols
powerline-fonts
iosevka
symbola
corefonts
ipaexfont
ipafont
liberation_ttf
migmix
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
open-sans
source-han-sans
source-sans
ubuntu_font_family
victor-mono
(nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ]; })
];
fontconfig = {
defaultFonts = {
serif = [ "Droid Sans Serif" "Ubuntu" ];
sansSerif = [ "Droid Sans" "Ubuntu" ];
monospace = [ "Fira Code" "Ubuntu" ];
emoji = [ "Noto Sans Emoji" ];
};
};
}; };
services = { services = {
openssh.enable = true; openssh = {
enable = true;
passwordAuthentication = false;
challengeResponseAuthentication = false;
permitRootLogin = "no";
};
gnome.gnome-keyring.enable = true; gnome.gnome-keyring.enable = true;
printing.enable = true; printing.enable = true;
dbus = { dbus = {
@ -261,17 +159,10 @@
}; };
}; };
security.sudo.extraConfig = ''
Defaults lecture = always
Defaults lecture_file = /etc/${config.environment.etc.sudoLecture.target}
'';
virtualisation = { virtualisation = {
docker.enable = true; docker.enable = true;
libvirtd.enable = true; libvirtd.enable = true;
}; };
system.stateVersion = "21.11";
} }

View File

@ -31,11 +31,6 @@
hybrid-sleep.enable = false; hybrid-sleep.enable = false;
}; };
nix.package = pkgs.nixFlakes;
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
# security.pam.services.login.unixAuth = true; # security.pam.services.login.unixAuth = true;
boot.loader = { boot.loader = {
@ -51,8 +46,6 @@
# efi.canTouchEfiVariables = true; # efi.canTouchEfiVariables = true;
}; };
time.timeZone = "Europe/Oslo";
networking = { networking = {
hostName = "Tsuki"; hostName = "Tsuki";
networkmanager.enable = true; networkmanager.enable = true;
@ -65,12 +58,6 @@
firewall.enable=true; firewall.enable=true;
}; };
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
services = { services = {
openssh = { openssh = {
enable = true; enable = true;
@ -90,102 +77,23 @@
users.groups.media = {}; users.groups.media = {};
users.users = { users.users = {
h7x4 = { h7x4.extraGroups = [
isNormalUser = true; "wheel"
extraGroups = [ "networkmanager"
"wheel" "docker"
"networkmanager" "disk"
"docker" "libvirtd"
"disk" "input"
"libvirtd" ];
"input"
];
shell = pkgs.zsh;
};
media = { media = {
isSystemUser = true; isSystemUser = true;
group = "media"; group = "media";
}; };
}; };
environment = { environment.systemPackages = with pkgs; [
variables = { wget
EDITOR = "nvim"; ];
VISUAL = "nvim";
};
systemPackages = with pkgs; [
wget
];
shells = with pkgs; [
bashInteractive
zsh
dash
];
etc = {
sudoLecture = {
target = "sudo.lecture";
text = "Be careful or something, idk...\n";
};
"resolv.conf" = with lib; with pkgs; {
source = writeText "resolv.conf" ''
${concatStringsSep "\n" (map (ns: "nameserver ${ns}") config.networking.nameservers)}
options edns0
'';
};
currentSystemPackages = {
target = "current-system-packages";
text = let
inherit (lib.strings) concatStringsSep;
inherit (lib.lists) sort;
inherit (lib.trivial) lessThan;
packages = map (p: "${p.name}") config.environment.systemPackages;
sortedUnique = sort lessThan (lib.unique packages);
in concatStringsSep "\n" sortedUnique;
};
};
};
fonts = {
enableDefaultFonts = true;
fonts = with pkgs; [
cm_unicode
dejavu_fonts
fira-code
fira-code-symbols
powerline-fonts
iosevka
symbola
corefonts
ipaexfont
ipafont
liberation_ttf
migmix
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
open-sans
source-han-sans
source-sans
ubuntu_font_family
victor-mono
(nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ]; })
];
fontconfig = {
defaultFonts = {
serif = [ "Droid Sans Serif" "Ubuntu" ];
sansSerif = [ "Droid Sans" "Ubuntu" ];
monospace = [ "Fira Code" "Ubuntu" ];
emoji = [ "Noto Sans Emoji" ];
};
};
};
programs = { programs = {
git.enable = true; git.enable = true;
@ -221,17 +129,8 @@
}; };
}; };
security.sudo.extraConfig = ''
Defaults lecture = always
Defaults lecture_file = /etc/${config.environment.etc.sudoLecture.target}
'';
virtualisation = { virtualisation = {
docker.enable = true; docker.enable = true;
libvirtd.enable = true; libvirtd.enable = true;
}; };
system.stateVersion = "21.11";
} }

View File

@ -1,50 +1,28 @@
{ pkgs, ... }: { pkgs, machineVars, ... }:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
ahoviewer
anki
asciidoctor asciidoctor
audacity
beets beets
biber biber
calibre python39Packages.bpython
castnow castnow
citra
cool-retro-term
copyq
czkawka czkawka
darktable
desmume
discord
diskonaut diskonaut
diskus diskus
docker docker
du-dust du-dust
fcitx
fd fd
ffmpeg ffmpeg
geogebra
gnome.gnome-font-viewer
google-chrome
# gpgtui # gpgtui
graphviz graphviz
# hck hck
hexyl hexyl
imagemagick imagemagick
inkscape
insomnia
jq jq
kepubify kepubify
kid3
koreader
krita
ktouch
lastpass-cli lastpass-cli
lazydocker lazydocker
libreoffice-fresh
light
lolcat lolcat
maim
manix manix
mdcat mdcat
mdp mdp
@ -52,59 +30,27 @@
megacmd megacmd
megasync megasync
micro micro
minecraft
mkvtoolnix mkvtoolnix
mmv mmv
mopidy
mopidy-mpd
mopidy-soundcloud
mopidy-spotify
mopidy-youtube
mpc_cli
mps-youtube mps-youtube
neofetch neofetch
nmap nmap
nyxt
osu-lazer
ouch ouch
pandoc pandoc
pulseaudio
pulsemixer
python3 python3
ripgrep ripgrep
rsync rsync
rust-motd rust-motd
sc-im sc-im
scrcpy
slack
slack-term slack-term
# steam-tui
sxiv
tagainijisho
taisei
tealdeer tealdeer
teams
# tenacity
# tv-renamer # tv-renamer
toilet toilet
tokei tokei
touchegg
w3m w3m
waifu2x-converter-cpp waifu2x-converter-cpp
wavemon wavemon
xcalib
xclip
xdotool
xfce.thunar
xfce.thunar-archive-plugin
xfce.thunar-dropbox-plugin
xfce.thunar-media-tags-plugin
xfce.thunar-volman
youtube-dl youtube-dl
# yuzu-mainline
zeal
zoom-us
zotero
# Needed for VSCode liveshare # Needed for VSCode liveshare
desktop-file-utils desktop-file-utils
@ -113,6 +59,66 @@
icu icu
openssl openssl
xorg.xprop xorg.xprop
]; ] ++ (
lib.optionals (!machineVars.headless) [
ahoviewer
anki
audacity
calibre
cool-retro-term
copyq
darktable
discord
fcitx
geogebra
gnome.gnome-font-viewer
google-chrome
inkscape
insomnia
kid3
koreader
krita
ktouch
libreoffice-fresh
light
maim
mopidy
mopidy-mpd
mopidy-soundcloud
mopidy-spotify
mopidy-youtube
mpc_cli
nyxt
pulseaudio
pulsemixer
scrcpy
slack
sxiv
tagainijisho
teams
tenacity
xcalib
xclip
xdotool
xfce.thunar
xfce.thunar-archive-plugin
xfce.thunar-dropbox-plugin
xfce.thunar-media-tags-plugin
xfce.thunar-volman
yuzu-mainline
zeal
zoom-us
zotero
] ++ lib.optionals (machineVars.laptop) [
touchegg
] ++ lib.optionals (machineVars.gaming) [
citra
desmume
minecraft
osu-lazer
steam-tui
taisei
]
);
} }