massive refactor!! done!!
This commit is contained in:
parent
fde702526c
commit
00b3e60c6c
|
@ -0,0 +1,76 @@
|
|||
{
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) toString;
|
||||
inherit (lib.modules) mkAliasOptionModule mkDefault mkIf;
|
||||
inherit (lib.my) mapModulesRec';
|
||||
in {
|
||||
imports =
|
||||
[
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
inputs.nix-colors.homeManagerModules.default
|
||||
(mkAliasOptionModule ["hm"] ["home-manager" "users" config.user.name])
|
||||
]
|
||||
++ (mapModulesRec' (toString ./modules) import);
|
||||
|
||||
# Common config for all nixos machines;
|
||||
environment.variables = {
|
||||
NIXPKGS_ALLOW_UNFREE = "1";
|
||||
};
|
||||
|
||||
nix = {
|
||||
package = pkgs.nixVersions.stable;
|
||||
|
||||
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; # Enables use of `nix-shell -p ...` etc
|
||||
registry.nixpkgs.flake = inputs.nixpkgs; # Make `nix shell` etc use pinned nixpkgs
|
||||
|
||||
settings = {
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
auto-optimise-store = true;
|
||||
substituters = ["https://nix-community.cachix.org"];
|
||||
trusted-public-keys = [
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
system = {
|
||||
stateVersion = "23.11";
|
||||
configurationRevision = with inputs; mkIf (self ? rev) self.rev;
|
||||
};
|
||||
hm.home.stateVersion = config.system.stateVersion;
|
||||
|
||||
boot = {
|
||||
kernelPackages = mkDefault pkgs.unstable.linuxPackages_latest;
|
||||
kernelParams = ["pcie_aspm.policy=performance"];
|
||||
};
|
||||
|
||||
# Configure keymap in X11
|
||||
services.xserver = {
|
||||
layout = "us";
|
||||
xkbVariant = "workman";
|
||||
};
|
||||
console = {
|
||||
useXkbConfig = mkDefault true;
|
||||
};
|
||||
|
||||
time.timeZone = mkDefault "Europe/Moscow";
|
||||
|
||||
i18n.defaultLocale = mkDefault "en_GB.UTF-8";
|
||||
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
unrar unzip
|
||||
micro
|
||||
curl wget
|
||||
desktop-file-utils
|
||||
shared-mime-info
|
||||
xdg-user-dirs
|
||||
xdg-utils
|
||||
];
|
||||
}
|
34
flake.lock
34
flake.lock
|
@ -36,11 +36,11 @@
|
|||
},
|
||||
"hardware": {
|
||||
"locked": {
|
||||
"lastModified": 1704458188,
|
||||
"narHash": "sha256-f6BYEuIqnbrs6J/9m1/1VdkJ6d63hO9kUC09kTPuOqE=",
|
||||
"lastModified": 1704632650,
|
||||
"narHash": "sha256-83J/nd/NoLqo3vj0S0Ppqe8L+ijIFiGL6HNDfCCUD/Q=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "172385318068519900a7d71c1024242fa6af75f0",
|
||||
"rev": "c478b3d56969006e015e55aaece4931f3600c1b2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -122,34 +122,32 @@
|
|||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1704194953,
|
||||
"narHash": "sha256-RtDKd8Mynhe5CFnVT8s0/0yqtWFMM9LmCzXv/YKxnq4=",
|
||||
"owner": "nixos",
|
||||
"lastModified": 1704161960,
|
||||
"narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "bd645e8668ec6612439a9ee7e71f7eac4099d4f6",
|
||||
"rev": "63143ac2c9186be6d9da6035fa22620018c85932",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
"id": "nixpkgs",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1704295289,
|
||||
"narHash": "sha256-9WZDRfpMqCYL6g/HNWVvXF0hxdaAgwgIGeLYiOhmes8=",
|
||||
"owner": "nixos",
|
||||
"lastModified": 1704420045,
|
||||
"narHash": "sha256-C36QmoJd5tdQ5R9MC1jM7fBkZW9zBUqbUCsgwS6j4QU=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b0b2c5445c64191fd8d0b31f2b1a34e45a64547d",
|
||||
"rev": "c1be43e8e837b8dbee2b3665a007e761680f0c3d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"id": "nixpkgs",
|
||||
"ref": "nixos-23.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
|
|
88
flake.nix
88
flake.nix
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
description = "goop-drive config";
|
||||
description = "λ simple and configureable Nix-Flake repository!";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
nixpkgs.url = "nixpkgs/nixos-23.11";
|
||||
nixpkgs-unstable.url = "nixpkgs/nixpkgs-unstable";
|
||||
|
||||
home-manager.url = "github:nix-community/home-manager/release-23.11";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
@ -14,59 +14,47 @@
|
|||
catppuccin-vsc.url = "github:catppuccin/vscode";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
outputs = inputs @ {
|
||||
self,
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
catppuccin-vsc,
|
||||
nixpkgs-unstable,
|
||||
...
|
||||
} @ inputs: let
|
||||
inherit (self) outputs;
|
||||
# Supported systems for your flake packages, shell, etc.
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
];
|
||||
# This is a function that generates an attribute by calling a function you
|
||||
# pass to it, with each system as an argument
|
||||
forAllSystems = nixpkgs.lib.genAttrs systems;
|
||||
}: let
|
||||
inherit (lib.my) mapModules mapModulesRec mapHosts;
|
||||
system = "x86_64-linux";
|
||||
|
||||
mkPkgs = pkgs: extraOverlays:
|
||||
import pkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
config.allowAliases = false;
|
||||
overlays = extraOverlays ++ (lib.attrValues self.overlays);
|
||||
};
|
||||
pkgs = mkPkgs nixpkgs [ self.overlays.default inputs.catppuccin-vsc.overlays.default ];
|
||||
pkgs-unstable = mkPkgs nixpkgs-unstable [];
|
||||
|
||||
lib = nixpkgs.lib.extend (final: prev: {
|
||||
my = import ./lib {
|
||||
inherit pkgs inputs;
|
||||
lib = final;
|
||||
};
|
||||
});
|
||||
in {
|
||||
# Your custom packages
|
||||
# Accessible through 'nix build', 'nix shell', etc
|
||||
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
|
||||
# Formatter for your nix files, available through 'nix fmt'
|
||||
# Other options beside 'alejandra' include 'nixpkgs-fmt'
|
||||
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
|
||||
lib = lib.my;
|
||||
|
||||
# Your custom packages and modifications, exported as overlays
|
||||
overlays = import ./overlays {inherit inputs;};
|
||||
# Reusable nixos modules you might want to export
|
||||
# These are usually stuff you would upstream into nixpkgs
|
||||
nixosModules = import ./modules/nixos;
|
||||
# Reusable home-manager modules you might want to export
|
||||
# These are usually stuff you would upstream into home-manager
|
||||
homeManagerModules = import ./modules/home-manager;
|
||||
|
||||
# NixOS configuration entrypoint
|
||||
# Available through 'nixos-rebuild --flake .#your-hostname'
|
||||
nixosConfigurations = {
|
||||
goop-drive = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {inherit inputs outputs;};
|
||||
modules = [
|
||||
./nixos/configuration.nix
|
||||
];
|
||||
overlays =
|
||||
(mapModules ./overlays import)
|
||||
// {
|
||||
default = final: prev: {
|
||||
unstable = pkgs-unstable;
|
||||
my = self.packages.${system};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Standalone home-manager configuration entrypoint
|
||||
# Available through 'home-manager --flake .#your-username@your-hostname'
|
||||
homeConfigurations = {
|
||||
"oatmealine@goop-drive" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
extraSpecialArgs = {inherit inputs outputs;};
|
||||
modules = [
|
||||
./home-manager/home.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
packages."${system}" = mapModules ./packages (p: pkgs.callPackage p {});
|
||||
|
||||
nixosModules = mapModulesRec ./modules import;
|
||||
|
||||
nixosConfigurations = mapHosts ./hosts {};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
jnoortheen.nix-ide
|
||||
sumneko.lua
|
||||
ms-vsliveshare.vsliveshare
|
||||
(catppuccin.catppuccin-vsc.override {
|
||||
accent = "pink";
|
||||
boldKeywords = false;
|
||||
italicComments = false;
|
||||
italicKeywords = false;
|
||||
extraBordersEnabled = false;
|
||||
workbenchMode = "flat";
|
||||
#bracketMode = "rainbow";
|
||||
})
|
||||
];
|
||||
mutableExtensionsDir = false;
|
||||
enableExtensionUpdateCheck = false;
|
||||
enableUpdateCheck = false;
|
||||
userSettings = with config.opinions.fonts; {
|
||||
"telemetry.enableTelemetry" = false;
|
||||
|
||||
"editor.tabSize" = 2;
|
||||
"editor.cursorSmoothCaretAnimation" = "on";
|
||||
|
||||
"editor.fontFamily" = "'${monospace.family}', monospace";
|
||||
"editor.fontSize" = monospace.size + 3; # no clue why i have to do this
|
||||
|
||||
"terminal.integrated.fontFamily" = "\"${monospace.family}\"";
|
||||
"terminal.integrated.fontSize" = monospace.size + 3;
|
||||
|
||||
"window.dialogStyle" = "custom";
|
||||
"window.titleBarStyle" = "custom";
|
||||
|
||||
"workbench.tips.enabled" = false;
|
||||
"workbench.colorTheme" = "Catppuccin Mocha";
|
||||
|
||||
"nix.enableLanguageServer" = true;
|
||||
"nix.serverPath" = "${lib.getExe pkgs.nil}";
|
||||
|
||||
"security.workspace.trust.untrustedFiles" = "open";
|
||||
|
||||
"explorer.confirmDelete" = false;
|
||||
"explorer.confirmDragAndDrop" = false;
|
||||
|
||||
"editor.bracketPairColorization.enabled" = false;
|
||||
"editor.smoothScrolling" = true;
|
||||
"editor.wordWrap" = "on";
|
||||
"editor.wrappingStrategy" = "advanced";
|
||||
"editor.fontWeight" = "normal";
|
||||
"editor.semanticHighlighting.enabled" = true;
|
||||
|
||||
# prevent VSCode from modifying the terminal colors
|
||||
"terminal.integrated.minimumContrastRatio" = 1;
|
||||
};
|
||||
};
|
||||
|
||||
programs.micro = {
|
||||
enable = true;
|
||||
settings = {
|
||||
autosu = true;
|
||||
clipboard = "terminal";
|
||||
savecursor = true;
|
||||
scrollbar = true;
|
||||
tabsize = 2;
|
||||
tabstospaces = true;
|
||||
};
|
||||
};
|
||||
microColors.enable = true;
|
||||
}
|
|
@ -1,190 +0,0 @@
|
|||
{ inputs, outputs, pkgs, lib, config, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
inputs.nix-colors.homeManagerModules.default
|
||||
outputs.homeManagerModules.alacritty
|
||||
outputs.homeManagerModules.opinions
|
||||
outputs.homeManagerModules.gtkConfig
|
||||
outputs.homeManagerModules.shellColors
|
||||
outputs.homeManagerModules.microColors
|
||||
outputs.homeManagerModules.gnomeBindings
|
||||
outputs.homeManagerModules.disableNews
|
||||
./editors.nix
|
||||
];
|
||||
|
||||
home.username = "oatmealine";
|
||||
home.homeDirectory = "/home/oatmealine";
|
||||
|
||||
nixpkgs.overlays = [
|
||||
outputs.overlays.additions
|
||||
outputs.overlays.unstable-packages
|
||||
inputs.catppuccin-vsc.overlays.default
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Packages that should be installed to the user profile.
|
||||
home.packages = with pkgs; let
|
||||
discord = unstable.discord-canary.override {
|
||||
withOpenASAR = true;
|
||||
withVencord = true;
|
||||
};
|
||||
in [
|
||||
# archives
|
||||
zip xz unzip p7zip
|
||||
# utils
|
||||
ripgrep jq
|
||||
# nix
|
||||
nix-output-monitor
|
||||
# dev
|
||||
sqlitebrowser sqlite-interactive
|
||||
# system
|
||||
btop sysstat lm_sensors ethtool pciutils usbutils powertop killall
|
||||
# debug
|
||||
strace ltrace lsof
|
||||
# apps
|
||||
vivaldi telegram-desktop onlyoffice-bin gnome.gnome-tweaks discord mpv
|
||||
# compatilibility
|
||||
wine
|
||||
# misc
|
||||
cowsay file which tree gnused grc
|
||||
# um
|
||||
doas-sudo-shim gnome.dconf-editor rbw
|
||||
];
|
||||
|
||||
colorScheme = inputs.nix-colors.colorSchemes.catppuccin-mocha;
|
||||
|
||||
opinions = {
|
||||
fonts = {
|
||||
regular = {
|
||||
package = pkgs.atkinson-hyperlegible;
|
||||
family = "Atkinson Hyperlegible";
|
||||
size = 11;
|
||||
};
|
||||
monospace = {
|
||||
package = pkgs.cozette;
|
||||
family = "CozetteVector";
|
||||
size = 10;
|
||||
};
|
||||
monospaceBitmap = {
|
||||
package = pkgs.cozette;
|
||||
family = "Cozette";
|
||||
size = 10;
|
||||
};
|
||||
};
|
||||
|
||||
lowercaseXdgDirs = true;
|
||||
};
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = ''Jill "oatmealine" Monoids'';
|
||||
userEmail = "oatmealine@disroot.org";
|
||||
|
||||
extraConfig = {
|
||||
push.autoSetupRemote = true;
|
||||
pull.rebase = true;
|
||||
init.defaultBranch = "main";
|
||||
};
|
||||
};
|
||||
|
||||
gtkConfig = {
|
||||
enable = true;
|
||||
preferDark = true;
|
||||
cursor = {
|
||||
package = pkgs.graphite-cursors;
|
||||
name = "graphite-dark";
|
||||
};
|
||||
icon = {
|
||||
package = pkgs.papirus-nord;
|
||||
name = "Papirus-Dark";
|
||||
};
|
||||
};
|
||||
|
||||
alacritty.enable = true;
|
||||
shellColors.enable = true;
|
||||
programs.fish.enable = true;
|
||||
programs.fish.plugins = [ { name = "grc"; src = pkgs.fishPlugins.grc.src; } ];
|
||||
services.syncthing.enable = true;
|
||||
services.syncthing.tray.enable = true;
|
||||
gnomeBindings.enable = true;
|
||||
gnomeBindings.shell = {
|
||||
# disable defaults
|
||||
"screenshot" = [];
|
||||
"screenshot-window" = [];
|
||||
"show-screenshot-ui" = [];
|
||||
};
|
||||
gnomeBindings.wm = {
|
||||
#"panel-run-dialog" = [ "Launch1" ];
|
||||
};
|
||||
gnomeBindings.custom = {
|
||||
"take-screenshot" = {
|
||||
binding = "Print";
|
||||
command = "${lib.getExe pkgs.flameshot} gui";
|
||||
};
|
||||
"take-screen-recording" = {
|
||||
binding = "<Shift>Print";
|
||||
command = "${lib.getExe pkgs.peek}";
|
||||
};
|
||||
"grab-password" = let
|
||||
grabScript = pkgs.writeScript "grab-password" ''
|
||||
${lib.getExe pkgs.rbw} get $(${lib.getExe pkgs.gnome.zenity} --entry --text="" --title="") | ${lib.getExe pkgs.xclip} -selection clipboard
|
||||
'';
|
||||
in {
|
||||
binding = "Launch1";
|
||||
command = ''${grabScript}'';
|
||||
};
|
||||
};
|
||||
# usually you don't need to do this, but this is a workaround for https://github.com/flameshot-org/flameshot/issues/3328
|
||||
services.flameshot.enable = true;
|
||||
|
||||
programs.rbw = let
|
||||
passwordPath = "/home/oatmealine/sync/secrets/bitwardenpass-raw";
|
||||
# thank you, random site i found with google
|
||||
# https://fossies.org/linux/gnupg/tests/fake-pinentries/fake-pinentry.sh
|
||||
getPassword = pkgs.writeShellScriptBin "get-bw-password" ''
|
||||
echo "OK ready"
|
||||
while read cmd rest; do
|
||||
cmd=$(printf "%s" "$cmd" | tr 'A-Z' 'a-z')
|
||||
if [ -z "$cmd" ]; then
|
||||
continue;
|
||||
fi
|
||||
case "$cmd" in
|
||||
\#*)
|
||||
;;
|
||||
getpin)
|
||||
echo "D $(cat ${passwordPath})"
|
||||
echo "OK"
|
||||
;;
|
||||
bye)
|
||||
echo "OK"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "OK"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
'';
|
||||
in {
|
||||
enable = true;
|
||||
settings.base_url = "https://bitwarden.lavatech.top";
|
||||
settings.email = "oatmealine@disroot.org";
|
||||
settings.lock_timeout = 60 * 60 * 24 * 7; # 1 week
|
||||
settings.pinentry = getPassword.overrideAttrs (old: { binaryPath = "bin/get-bw-password"; });
|
||||
};
|
||||
|
||||
# This value determines the home Manager release that your
|
||||
# configuration is compatible with. This helps avoid breakage
|
||||
# when a new home Manager release introduces backwards
|
||||
# incompatible changes.
|
||||
#
|
||||
# You can update home Manager without changing this value. See
|
||||
# the home Manager release notes for a list of state version
|
||||
# changes in each release.
|
||||
home.stateVersion = "23.11";
|
||||
|
||||
# Let home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{
|
||||
imports = [ ./hardware.nix ];
|
||||
|
||||
hm.home.packages = with pkgs; [
|
||||
# archives
|
||||
zip xz unzip p7zip
|
||||
# utils
|
||||
ripgrep jq
|
||||
# nix
|
||||
nix-output-monitor
|
||||
# dev
|
||||
sqlitebrowser sqlite-interactive
|
||||
# system
|
||||
btop sysstat lm_sensors ethtool pciutils usbutils powertop killall
|
||||
# debug
|
||||
strace ltrace lsof
|
||||
# apps
|
||||
vivaldi telegram-desktop onlyoffice-bin mpv
|
||||
# compatilibility
|
||||
wine
|
||||
# misc
|
||||
cowsay file which tree gnused yt-dlp
|
||||
];
|
||||
|
||||
# usually you don't need to do this, but this is a workaround for https://github.com/flameshot-org/flameshot/issues/3328
|
||||
hm.services.flameshot.enable = true;
|
||||
|
||||
modules = {
|
||||
security.useDoas = true;
|
||||
|
||||
hardware = {
|
||||
pipewire.enable = true;
|
||||
};
|
||||
desktop = {
|
||||
envProto = "x11";
|
||||
gnome.enable = true;
|
||||
gnome.keybinds.shell = {
|
||||
# disable defaults
|
||||
"screenshot" = [];
|
||||
"screenshot-window" = [];
|
||||
"show-screenshot-ui" = [];
|
||||
};
|
||||
gnome.keybinds.custom = {
|
||||
"take-screenshot" = {
|
||||
binding = "Print";
|
||||
command = "${lib.getExe pkgs.flameshot} gui";
|
||||
};
|
||||
"take-screen-recording" = {
|
||||
binding = "<Shift>Print";
|
||||
command = "${lib.getExe pkgs.peek}";
|
||||
};
|
||||
"grab-password" = let
|
||||
grabScript = pkgs.writeScript "grab-password" ''
|
||||
${lib.getExe pkgs.rbw} get $(${lib.getExe pkgs.gnome.zenity} --entry --text="" --title="") | ${lib.getExe pkgs.xclip} -selection clipboard
|
||||
'';
|
||||
in {
|
||||
binding = "Launch1";
|
||||
command = ''${grabScript}'';
|
||||
};
|
||||
};
|
||||
themes.active = "catppuccin";
|
||||
};
|
||||
software = {
|
||||
# system
|
||||
system.alacritty.enable = true;
|
||||
system.fish.enable = true;
|
||||
system.syncthing.enable = true;
|
||||
# dev
|
||||
dev.git.enable = true;
|
||||
# editors
|
||||
editors.vscode.enable = true;
|
||||
editors.micro.enable = true;
|
||||
# tools
|
||||
tools.rbw.enable = true;
|
||||
tools.noisetorch.enable = true;
|
||||
# distractions
|
||||
distractions.steam.enable = true;
|
||||
distractions.discord.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,9 +1,14 @@
|
|||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
{ inputs, config, lib, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
imports = [
|
||||
inputs.hardware.nixosModules.common-cpu-intel
|
||||
inputs.hardware.nixosModules.common-pc-laptop-ssd
|
||||
inputs.hardware.nixosModules.common-pc-laptop
|
||||
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
./lenovo-thinkpad-x1-1st-gen.nix
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
|
||||
boot.initrd.kernelModules = [ ];
|
|
@ -1,11 +1,11 @@
|
|||
# Largely based upon https://www.thinkwiki.org/wiki/X1_Linux_Tweaks
|
||||
|
||||
{ config, ... }:
|
||||
{ ... }:
|
||||
{
|
||||
# Laptop-specific battery usage tuning
|
||||
powerManagement.enable = true;
|
||||
# Tune power saving options on boot
|
||||
#powerManagement.powertop.enable = true;
|
||||
powerManagement.powertop.enable = true;
|
||||
# Thermald proactively prevents overheating on Intel CPUs and works well with other tools.
|
||||
services.thermald.enable = true;
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.lists) any count;
|
||||
inherit (lib.attrsets) filterAttrs listToAttrs mapAttrs' mapAttrsToList;
|
||||
in rec {
|
||||
# attrsToList
|
||||
attrsToList = attrs:
|
||||
mapAttrsToList (name: value: {inherit name value;}) attrs;
|
||||
|
||||
# mapFilterAttrs ::
|
||||
# (name -> value -> bool)
|
||||
# (name -> value -> { name = any; value = any; })
|
||||
# attrs
|
||||
mapFilterAttrs = pred: f: attrs: filterAttrs pred (mapAttrs' f attrs);
|
||||
|
||||
# Generate an attribute set by mapping a function over a list of values.
|
||||
genAttrs' = values: f: listToAttrs (map f values);
|
||||
|
||||
# anyAttrs :: (name -> value -> bool) attrs
|
||||
anyAttrs = pred: attrs:
|
||||
any (attr: pred attr.name attr.value) (attrsToList attrs);
|
||||
|
||||
# countAttrs :: (name -> value -> bool) attrs
|
||||
countAttrs = pred: attrs:
|
||||
count (attr: pred attr.name attr.value) (attrsToList attrs);
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.attrsets) attrValues;
|
||||
inherit (lib.fixedPoints) makeExtensible;
|
||||
inherit (lib.lists) foldr;
|
||||
inherit (modules) mapModules;
|
||||
|
||||
modules = import ./modules.nix {
|
||||
inherit lib;
|
||||
self.attrs = import ./attrs.nix {
|
||||
inherit lib;
|
||||
self = {};
|
||||
};
|
||||
};
|
||||
mylib =
|
||||
makeExtensible (self:
|
||||
mapModules ./. (file: import file {inherit self lib pkgs inputs;}));
|
||||
in
|
||||
mylib.extend (self: super: foldr (a: b: a // b) {} (attrValues super))
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) baseNameOf;
|
||||
inherit (lib.strings) removeSuffix;
|
||||
in {
|
||||
toCSSFile = file: let
|
||||
fileName = removeSuffix ".scss" (baseNameOf file);
|
||||
compiledStyles = pkgs.runCommand "compileScssFile" {buildInputs = [pkgs.sass];} ''
|
||||
mkdir "$out"
|
||||
scss --sourcemap=none \
|
||||
--no-cache \
|
||||
--style compressed \
|
||||
--default-encoding utf-8 \
|
||||
"${file}" \
|
||||
>>"$out/${fileName}.css"
|
||||
'';
|
||||
in "${compiledStyles}/${fileName}.css";
|
||||
|
||||
toFilteredImage = imageFile: options: let
|
||||
result = "result.png";
|
||||
filteredImage =
|
||||
pkgs.runCommand "filterWallpaper" {
|
||||
buildInputs = [pkgs.imagemagick];
|
||||
} ''
|
||||
mkdir "$out"
|
||||
convert ${options} ${imageFile} $out/${result}
|
||||
'';
|
||||
in "${filteredImage}/${result}";
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
lib,
|
||||
self,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) attrValues readDir pathExists concatLists;
|
||||
inherit (lib.attrsets) mapAttrsToList filterAttrs nameValuePair;
|
||||
inherit (lib.strings) hasPrefix hasSuffix removeSuffix;
|
||||
inherit (lib.trivial) id;
|
||||
inherit (self.attrs) mapFilterAttrs;
|
||||
in rec {
|
||||
mapModules = dir: fn:
|
||||
mapFilterAttrs (n: v: v != null && !(hasPrefix "_" n)) (n: v: let
|
||||
path = "${toString dir}/${n}";
|
||||
in
|
||||
if v == "directory" && pathExists "${path}/default.nix"
|
||||
then nameValuePair n (fn path)
|
||||
else if v == "regular" && n != "default.nix" && hasSuffix ".nix" n
|
||||
then nameValuePair (removeSuffix ".nix" n) (fn path)
|
||||
else nameValuePair "" null) (readDir dir);
|
||||
|
||||
mapModules' = dir: fn: attrValues (mapModules dir fn);
|
||||
|
||||
mapModulesRec = dir: fn:
|
||||
mapFilterAttrs (n: v: v != null && !(hasPrefix "_" n)) (n: v: let
|
||||
path = "${toString dir}/${n}";
|
||||
in
|
||||
if v == "directory"
|
||||
then nameValuePair n (mapModulesRec path fn)
|
||||
else if v == "regular" && n != "default.nix" && hasSuffix ".nix" n
|
||||
then nameValuePair (removeSuffix ".nix" n) (fn path)
|
||||
else nameValuePair "" null) (readDir dir);
|
||||
|
||||
mapModulesRec' = dir: fn: let
|
||||
dirs =
|
||||
mapAttrsToList (k: _: "${dir}/${k}")
|
||||
(filterAttrs (n: v: v == "directory" && !(hasPrefix "_" n))
|
||||
(readDir dir));
|
||||
files = attrValues (mapModules dir id);
|
||||
paths = files ++ concatLists (map (d: mapModulesRec' d id) dirs);
|
||||
in
|
||||
map fn paths;
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
self,
|
||||
...
|
||||
}: let
|
||||
inherit (inputs.nixpkgs.lib) nixosSystem;
|
||||
inherit (builtins) baseNameOf elem;
|
||||
inherit (lib.attrsets) filterAttrs;
|
||||
inherit (lib.modules) mkDefault;
|
||||
inherit (lib.strings) removeSuffix;
|
||||
inherit (self.modules) mapModules;
|
||||
in rec {
|
||||
mkHost = path: attrs @ {system ? "x86_64-linux", ...}:
|
||||
nixosSystem {
|
||||
inherit system;
|
||||
|
||||
specialArgs = {inherit lib inputs system;};
|
||||
|
||||
modules = [
|
||||
{
|
||||
nixpkgs.pkgs = pkgs;
|
||||
networking.hostName =
|
||||
mkDefault (removeSuffix ".nix" (baseNameOf path));
|
||||
}
|
||||
(filterAttrs (n: v: !elem n ["system"]) attrs)
|
||||
../. # /default.nix
|
||||
(import path)
|
||||
];
|
||||
};
|
||||
|
||||
mapHosts = dir: attrs @ {system ? system, ...}:
|
||||
mapModules dir (hostPath: mkHost hostPath attrs);
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkOption;
|
||||
in {
|
||||
mkOpt = type: default: mkOption {inherit type default;};
|
||||
|
||||
mkOpt' = type: default: description:
|
||||
mkOption {inherit type default description;};
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
# Module template
|
||||
|
||||
{ lib, config, inputs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.thing;
|
||||
in {
|
||||
options.thing = {
|
||||
enable = mkEnableOption "TODO";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
};
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop;
|
||||
in {
|
||||
options.modules.desktop = {
|
||||
envProto = mkOption {
|
||||
type = types.nullOr (types.enum ["x11" "wayland"]);
|
||||
description = "What display protocol to use.";
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
env = {
|
||||
QT_QPA_PLATFORMTHEME = "gnome";
|
||||
QT_STYLE_OVERRIDE = "Adwaita";
|
||||
};
|
||||
|
||||
modules.desktop.fonts.enable = true;
|
||||
modules.desktop.fonts.baseFonts = true;
|
||||
|
||||
#xdg.portal = {
|
||||
# enable = true;
|
||||
# extraPortals = [pkgs.xdg-desktop-portal-gtk];
|
||||
# config.common.default = "*";
|
||||
#};
|
||||
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
|
||||
# Bootloader
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
# Enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# Speed up boot
|
||||
# https://discourse.nixos.org/t/boot-faster-by-disabling-udev-settle-and-nm-wait-online/6339
|
||||
systemd.services.systemd-udev-settle.enable = false;
|
||||
systemd.services.NetworkManager-wait-online.enable = false;
|
||||
};
|
||||
}
|
|
@ -0,0 +1,101 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
# ty https://github.com/Misterio77/nix-config/blob/main/modules/home-manager/fonts.nix
|
||||
mkFontOption = kind: default: {
|
||||
family = mkOption {
|
||||
type = types.str;
|
||||
default = default.family;
|
||||
description = "Family name for ${kind} font profile";
|
||||
example = "Fira Code";
|
||||
};
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = default.package;
|
||||
description = "Package for ${kind} font profile";
|
||||
example = "pkgs.fira-code";
|
||||
};
|
||||
size = mkOption {
|
||||
type = types.number;
|
||||
default = default.size;
|
||||
description = "${kind} font profile size, px";
|
||||
example = "11";
|
||||
};
|
||||
};
|
||||
cfg = config.modules.desktop.fonts;
|
||||
in {
|
||||
options.modules.desktop.fonts = {
|
||||
enable = mkEnableOption "Enable the font configuration module";
|
||||
baseFonts = mkEnableOption "Add a set of extra base fonts";
|
||||
|
||||
fonts = {
|
||||
sans = mkFontOption "sans" {
|
||||
package = pkgs.atkinson-hyperlegible;
|
||||
family = "Atkinson Hyperlegible";
|
||||
size = 11;
|
||||
};
|
||||
sansSerif = mkFontOption "sans-serif" {
|
||||
package = pkgs.atkinson-hyperlegible;
|
||||
family = "Atkinson Hyperlegible";
|
||||
size = 11;
|
||||
};
|
||||
monospace = mkFontOption "monospace" {
|
||||
package = pkgs.cozette;
|
||||
family = "CozetteVector";
|
||||
size = 10;
|
||||
};
|
||||
monospaceBitmap = mkFontOption "bitmap monospace" {
|
||||
package = pkgs.cozette;
|
||||
family = "Cozette";
|
||||
size = 10;
|
||||
};
|
||||
emoji = mkFontOption "emoji" {
|
||||
package = pkgs.twitter-color-emoji;
|
||||
family = "Twitter Color Emoji";
|
||||
size = 10; # not applicable, but whatever
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
fonts = {
|
||||
fontDir.enable = true;
|
||||
fontconfig.enable = true;
|
||||
fontconfig.defaultFonts = {
|
||||
sans = [ cfg.fonts.sans.family ];
|
||||
sansSerif = [ cfg.fonts.sansSerif.family ];
|
||||
monospace = [ cfg.fonts.monospace.family ];
|
||||
emoji = [ cfg.fonts.emoji.family ];
|
||||
};
|
||||
enableGhostscriptFonts = true;
|
||||
packages = with pkgs; [
|
||||
corefonts
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
liberation_ttf
|
||||
] ++ [
|
||||
cfg.fonts.sans.package
|
||||
cfg.fonts.sansSerif.package
|
||||
cfg.fonts.monospace.package
|
||||
cfg.fonts.monospaceBitmap.package
|
||||
cfg.fonts.emoji.package
|
||||
];
|
||||
};
|
||||
|
||||
hm.gtk.enable = true;
|
||||
hm.gtk.font = {
|
||||
inherit (cfg.fonts.sans) package name size;
|
||||
};
|
||||
} // (mkIf cfg.baseFonts {
|
||||
fonts.packages = with pkgs; [
|
||||
fira-code
|
||||
fira-code-symbols
|
||||
mplus-outline-fonts.githubRelease
|
||||
dina-font
|
||||
proggyfonts
|
||||
atkinson-hyperlegible
|
||||
cozette
|
||||
];
|
||||
});
|
||||
}
|
|
@ -0,0 +1,104 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.gnome;
|
||||
in {
|
||||
options.modules.desktop.gnome = {
|
||||
enable = mkEnableOption "Enable the Gnome desktop environment";
|
||||
keybinds = {
|
||||
shell = mkOption {
|
||||
description = ''Override Gnome shell keybindings (org/gnome/shell/keybindings/...)'';
|
||||
type = types.attrsOf (types.listOf types.str);
|
||||
example = ''{ screenshot = [ "<Ctrl>Print" ]; }'';
|
||||
default = {};
|
||||
};
|
||||
|
||||
wm = mkOption {
|
||||
description = ''Override Gnome window manager keybindings (org/gnome/desktop/wm/keybindings/...)'';
|
||||
type = types.attrsOf (types.listOf types.str);
|
||||
example = ''{ panel-run-dialog = [ "<Primary>r" ]; }'';
|
||||
default = {};
|
||||
};
|
||||
|
||||
mutter = mkOption {
|
||||
description = ''Override Mutter keybindings (org/gnome/mutter/keybindings/...)'';
|
||||
type = types.attrsOf (types.listOf types.str);
|
||||
example = ''{ rotate-monitor = [ "<Primary>l" ] }'';
|
||||
default = {};
|
||||
};
|
||||
|
||||
custom = mkOption {
|
||||
type = types.attrsOf (types.submodule {
|
||||
options = {
|
||||
binding = mkOption {
|
||||
description = "The keybind combination to activate this binding";
|
||||
example = ''"<Primary><Alt>t"'';
|
||||
};
|
||||
command = mkOption {
|
||||
description = "The command to execute upon activation";
|
||||
example = ''"alacritty"'';
|
||||
};
|
||||
};
|
||||
});
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.dconf.enable = true;
|
||||
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver.enable = true;
|
||||
|
||||
# Enable the GNOME Desktop Environment.
|
||||
services.xserver.desktopManager.gnome.enable = true;
|
||||
|
||||
services.xserver.displayManager.gdm = {
|
||||
enable = true;
|
||||
wayland = mkForce (config.modules.desktop.envProto == "wayland");
|
||||
};
|
||||
|
||||
services.gnome.sushi.enable = true;
|
||||
|
||||
hm.home.packages = with pkgs; [
|
||||
dconf2nix
|
||||
gnome.gnome-disk-utility
|
||||
gnome.dconf-editor
|
||||
gnome.gnome-tweaks
|
||||
] ++ (with pkgs.gnomeExtensions; [
|
||||
appindicator
|
||||
clipboard-indicator
|
||||
espresso
|
||||
user-themes
|
||||
|
||||
# just out of curiosity
|
||||
aylurs-widgets
|
||||
blur-my-shell
|
||||
dash-to-dock
|
||||
just-perfection
|
||||
rounded-window-corners
|
||||
space-bar
|
||||
]);
|
||||
|
||||
hm.dconf = let
|
||||
# [ binding ]
|
||||
customBindings = attrValues (mapAttrs (name: value: { name = name; binding = value.binding; command = value.command; }) cfg.keybinds.custom);
|
||||
# [ { key, binding } ]
|
||||
customBindingSets = imap0 (i: v: { name = "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${toString i}"; value = v; }) customBindings;
|
||||
# { key = binding }
|
||||
customBindingsAttr = listToAttrs customBindingSets;
|
||||
in {
|
||||
settings = {
|
||||
"org/gnome/settings-daemon/plugins/media-keys" = {
|
||||
custom-keybindings = map (n: "/${n}/") (attrNames customBindingsAttr);
|
||||
};
|
||||
|
||||
"org/gnome/shell/keybindings" = cfg.keybinds.shell;
|
||||
"org/gnome/desktop/wm/keybindings" = cfg.keybinds.wm;
|
||||
"org/gnome/mutter/keybindings" = cfg.keybinds.mutter;
|
||||
} // customBindingsAttr;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
{ inputs, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.themes;
|
||||
#accent = "pink"; # TODO?
|
||||
in {
|
||||
config = mkIf (cfg.active == "catppuccin") {
|
||||
colorScheme = inputs.nix-colors.colorSchemes.catppuccin-mocha;
|
||||
|
||||
modules.desktop.themes = {
|
||||
dark = true;
|
||||
|
||||
gtkTheme = {
|
||||
name = "Catppuccin-Mocha-Compact-Pink-Dark";
|
||||
package = pkgs.catppuccin-gtk.override {
|
||||
variant = "mocha";
|
||||
accents = ["pink"];
|
||||
tweaks = ["rimless"];
|
||||
size = "compact";
|
||||
};
|
||||
};
|
||||
|
||||
iconTheme = {
|
||||
name = "WhiteSur-dark";
|
||||
package = pkgs.whitesur-icon-theme;
|
||||
};
|
||||
|
||||
cursor = {
|
||||
package = pkgs.graphite-cursors;
|
||||
name = "graphite-dark";
|
||||
};
|
||||
|
||||
editor = {
|
||||
vscode = {
|
||||
name = "Catppuccin Mocha";
|
||||
extension = (pkgs.vscode-extensions.catppuccin.catppuccin-vsc.override {
|
||||
accent = "pink";
|
||||
boldKeywords = false;
|
||||
italicComments = false;
|
||||
italicKeywords = false;
|
||||
extraBordersEnabled = false;
|
||||
workbenchMode = "flat";
|
||||
#bracketMode = "rainbow";
|
||||
});
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.my;
|
||||
let
|
||||
cfg = config.modules.desktop.themes;
|
||||
in {
|
||||
options.modules.desktop.themes = with types; {
|
||||
active = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = "Name of the theme to apply; see modules/desktop/themes for a list of valid options";
|
||||
};
|
||||
|
||||
dark = mkOpt bool false;
|
||||
|
||||
gtkTheme = {
|
||||
name = mkOpt str "";
|
||||
package = mkPackageOption pkgs "gtk" {};
|
||||
};
|
||||
iconTheme = {
|
||||
name = mkOpt str "";
|
||||
package = mkPackageOption pkgs "icon" {};
|
||||
};
|
||||
cursor = {
|
||||
name = mkOpt str "";
|
||||
package = mkPackageOption pkgs "cursor" {};
|
||||
};
|
||||
|
||||
editor = {
|
||||
vscode = {
|
||||
name = mkOpt str "";
|
||||
extension = mkPackageOption pkgs "extension" {};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf (cfg.active != null) {
|
||||
programs.dconf.enable = true;
|
||||
|
||||
hm.dconf = {
|
||||
enable = true;
|
||||
settings."org/gnome/desktop/interface".color-scheme = mkIf cfg.dark "prefer-dark";
|
||||
};
|
||||
|
||||
hm.gtk = {
|
||||
enable = true;
|
||||
cursorTheme = cfg.cursor;
|
||||
iconTheme = cfg.iconTheme;
|
||||
theme = cfg.gtkTheme;
|
||||
};
|
||||
|
||||
hm.programs.vscode = {
|
||||
extensions = [ cfg.editor.vscode.extension ];
|
||||
userSettings = {
|
||||
"workbench.colorTheme" = cfg.editor.vscode.name;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
{
|
||||
options = {
|
||||
env = mkOption {
|
||||
type = with types; attrsOf (oneOf [str path (listOf (either str path))]);
|
||||
apply = mapAttrs (n: v:
|
||||
if isList v
|
||||
then concatMapStringsSep ":" (x: toString x) v
|
||||
else (toString v));
|
||||
default = {};
|
||||
description = "Provides easy-access to `environment.extraInit`";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
environment.extraInit =
|
||||
concatStringsSep "\n"
|
||||
(mapAttrsToList (n: v: ''export ${n}="${v}"'') config.env);
|
||||
};
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
# alacritty - a cross-platform, GPU-accelerated terminal emulator
|
||||
|
||||
{ lib, config, inputs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.alacritty;
|
||||
in {
|
||||
options.alacritty = {
|
||||
enable = mkEnableOption "Enable Alacritty config";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.alacritty = {
|
||||
enable = true;
|
||||
# custom settings
|
||||
settings = {
|
||||
env.TERM = "xterm-256color";
|
||||
window.resize_increments = true;
|
||||
colors.draw_bold_text_with_bright_colors = true;
|
||||
font = {
|
||||
normal = { family = config.opinions.fonts.monospaceBitmap.family; };
|
||||
size = config.opinions.fonts.monospaceBitmap.size;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
alacritty = import ./alacritty.nix;
|
||||
opinions = import ./opinions.nix;
|
||||
gtkConfig = import ./gtk-config.nix;
|
||||
shellColors = import ./shell-colors.nix;
|
||||
microColors = import ./micro-colors.nix;
|
||||
gnomeBindings = import ./gnome-bindings.nix;
|
||||
disableNews = import ./disable-news.nix;
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
# It doesn't even work out of the box with flakes...
|
||||
# <https://github.com/nix-community/home-manager/issues/2033#issuecomment-1801557851>
|
||||
#
|
||||
# Include this in the `modules` passed to
|
||||
# `inputs.home-manager.lib.homeManagerConfiguration`.
|
||||
{ lib, ... }: {
|
||||
# disabledModules = [ "misc/news.nix" ];
|
||||
config = {
|
||||
news.display = "silent";
|
||||
news.json = lib.mkForce { };
|
||||
news.entries = lib.mkForce [ ];
|
||||
};
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.gnomeBindings;
|
||||
in {
|
||||
options.gnomeBindings = {
|
||||
enable = mkEnableOption "Enable Gnome bindings";
|
||||
|
||||
shell = mkOption {
|
||||
description = ''Override Gnome shell keybindings (org/gnome/shell/keybindings/...)'';
|
||||
type = types.attrsOf (types.listOf types.str);
|
||||
example = ''{ screenshot = [ "<Ctrl>Print" ]; }'';
|
||||
default = {};
|
||||
};
|
||||
|
||||
wm = mkOption {
|
||||
description = ''Override Gnome window manager keybindings (org/gnome/desktop/wm/keybindings/...)'';
|
||||
type = types.attrsOf (types.listOf types.str);
|
||||
example = ''{ panel-run-dialog = [ "<Primary>r" ]; }'';
|
||||
default = {};
|
||||
};
|
||||
|
||||
mutter = mkOption {
|
||||
description = ''Override Mutter keybindings (org/gnome/mutter/keybindings/...)'';
|
||||
type = types.attrsOf (types.listOf types.str);
|
||||
example = ''{ rotate-monitor = [ "<Primary>l" ] }'';
|
||||
default = {};
|
||||
};
|
||||
|
||||
custom = mkOption {
|
||||
type = types.attrsOf (types.submodule {
|
||||
options = {
|
||||
binding = mkOption {
|
||||
description = "The keybind combination to activate this binding";
|
||||
example = ''"<Primary><Alt>t"'';
|
||||
};
|
||||
command = mkOption {
|
||||
description = "The command to execute upon activation";
|
||||
example = ''"alacritty"'';
|
||||
};
|
||||
};
|
||||
});
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (let
|
||||
# [ binding ]
|
||||
customBindings = attrValues (mapAttrs (name: value: { name = name; binding = value.binding; command = value.command; }) cfg.custom);
|
||||
# [ { key, binding } ]
|
||||
customBindingSets = imap0 (i: v: { name = "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${toString i}"; value = v; }) customBindings;
|
||||
# { key = binding }
|
||||
customBindingsAttr = listToAttrs customBindingSets;
|
||||
in {
|
||||
dconf.settings = {
|
||||
"org/gnome/settings-daemon/plugins/media-keys" = {
|
||||
custom-keybindings = map (n: "/${n}/") (attrNames customBindingsAttr);
|
||||
};
|
||||
|
||||
"org/gnome/shell/keybindings" = cfg.shell;
|
||||
"org/gnome/desktop/wm/keybindings" = cfg.wm;
|
||||
"org/gnome/mutter/keybindings" = cfg.mutter;
|
||||
} // customBindingsAttr;
|
||||
});
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
{ lib, config, inputs, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.gtkConfig;
|
||||
nix-colors-lib = inputs.nix-colors.lib.contrib { inherit pkgs; };
|
||||
in {
|
||||
options.gtkConfig = {
|
||||
enable = mkEnableOption "Enable GTK configuration";
|
||||
preferDark = mkEnableOption "Prefer dark themes";
|
||||
cursor = mkOption {
|
||||
type = types.submodule {
|
||||
options = {
|
||||
package = mkOption { type = types.package; };
|
||||
name = mkOption { type = types.str; };
|
||||
};
|
||||
};
|
||||
};
|
||||
icon = mkOption {
|
||||
type = types.submodule {
|
||||
options = {
|
||||
package = mkOption { type = types.package; };
|
||||
name = mkOption { type = types.str; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
dconf = {
|
||||
enable = true;
|
||||
settings."org/gnome/desktop/interface".color-scheme = mkIf cfg.preferDark "prefer-dark";
|
||||
};
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
cursorTheme = cfg.cursor;
|
||||
iconTheme = cfg.icon;
|
||||
font = {
|
||||
package = config.opinions.fonts.regular.package;
|
||||
name = config.opinions.fonts.regular.family;
|
||||
size = config.opinions.fonts.regular.size;
|
||||
};
|
||||
theme = {
|
||||
package = nix-colors-lib.gtkThemeFromScheme { scheme = config.colorScheme; };
|
||||
name = config.colorScheme.slug;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
# Opinionated tweaks and values. Mostly configurable!
|
||||
|
||||
{ lib, config, inputs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
# ty https://github.com/Misterio77/nix-config/blob/main/modules/home-manager/fonts.nix
|
||||
mkFontOption = kind: {
|
||||
family = mkOption {
|
||||
type = types.str;
|
||||
default = null;
|
||||
description = "Family name for ${kind} font profile";
|
||||
example = "Fira Code";
|
||||
};
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = null;
|
||||
description = "Package for ${kind} font profile";
|
||||
example = "pkgs.fira-code";
|
||||
};
|
||||
size = mkOption {
|
||||
type = types.number;
|
||||
default = 11;
|
||||
description = "${kind} font profile size, px";
|
||||
example = "11";
|
||||
};
|
||||
};
|
||||
cfg = config.opinions;
|
||||
in {
|
||||
options.opinions = {
|
||||
enable = mkEnableOption "Whether to enable opinionated tweaks";
|
||||
|
||||
fonts = mkOption {
|
||||
type = types.submodule {
|
||||
options = {
|
||||
regular = mkFontOption "regular";
|
||||
monospace = mkFontOption "monospace";
|
||||
monospaceBitmap = mkFontOption "bitmap monospace";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
lowercaseXdgDirs = mkEnableOption "Make XDG folder names all lowercase";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# fonts
|
||||
fonts.fontconfig.enable = true;
|
||||
home.packages = [ cfg.fonts.monospace.package cfg.regular.package ];
|
||||
|
||||
# xdg dirs
|
||||
xdg.userDirs = mkIf cfg.lowercaseXdgDirs {
|
||||
enable = true;
|
||||
createDirectories = true;
|
||||
|
||||
desktop = "$HOME/desktop";
|
||||
documents = "$HOME/documents";
|
||||
download = "$HOME/downloads";
|
||||
music = "$HOME/music";
|
||||
pictures = "$HOME/pictures";
|
||||
publicShare = "$HOME/public";
|
||||
templates = "$HOME/templates";
|
||||
videos = "$HOME/videos";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
# Sets up shell colors
|
||||
|
||||
{ lib, config, inputs, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.shellColors;
|
||||
nix-colors-lib = inputs.nix-colors.lib.contrib { inherit pkgs; };
|
||||
in {
|
||||
options.shellColors = {
|
||||
enable = mkEnableOption "Enable shell color config";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.fish = let
|
||||
colorScript = nix-colors-lib.shellThemeFromScheme { scheme = config.colorScheme; };
|
||||
in {
|
||||
interactiveShellInit = ''
|
||||
sh ${colorScript}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
gnome = ./gnome.nix;
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
{ lib, config, inputs, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.gnome;
|
||||
in {
|
||||
options.gnome = {
|
||||
enable = mkEnableOption "Use GNOME as the desktop manager";
|
||||
wayland = mkEnableOption "Use Wayland";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver.enable = true;
|
||||
|
||||
# Enable the GNOME Desktop Environment.
|
||||
services.xserver.desktopManager.gnome.enable = true;
|
||||
|
||||
services.xserver.displayManager.gdm = {
|
||||
enable = true;
|
||||
wayland = mkForce cfg.wayland;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.security;
|
||||
in {
|
||||
options.modules.security = {
|
||||
useDoas = mkEnableOption "Use opendoas instead of sudo";
|
||||
};
|
||||
|
||||
config = {
|
||||
boot = {
|
||||
tmp.useTmpfs = lib.mkDefault true;
|
||||
tmp.cleanOnBoot = lib.mkDefault (!config.boot.tmp.useTmpfs);
|
||||
|
||||
# Disable kernel-param editing on boot
|
||||
loader.systemd-boot.editor = false;
|
||||
|
||||
kernel.sysctl = {
|
||||
# Magic SysRq key -> allows performing low-level commands.
|
||||
"kernel.sysrq" = 0;
|
||||
|
||||
## TCP hardening
|
||||
# Prevent bogus ICMP errors from filling up logs.
|
||||
"net.ipv4.icmp_ignore_bogus_error_responses" = 1;
|
||||
# Reverse path filtering causes the kernel to do source validation of
|
||||
# packets received from all interfaces. This can mitigate IP spoofing.
|
||||
"net.ipv4.conf.default.rp_filter" = 1;
|
||||
"net.ipv4.conf.all.rp_filter" = 1;
|
||||
# Do not accept IP source route packets (we're not a router)
|
||||
"net.ipv4.conf.all.accept_source_route" = 0;
|
||||
"net.ipv6.conf.all.accept_source_route" = 0;
|
||||
# Don't send ICMP redirects (again, we're on a router)
|
||||
"net.ipv4.conf.all.send_redirects" = 0;
|
||||
"net.ipv4.conf.default.send_redirects" = 0;
|
||||
# Refuse ICMP redirects (MITM mitigations)
|
||||
"net.ipv4.conf.all.accept_redirects" = 0;
|
||||
"net.ipv4.conf.default.accept_redirects" = 0;
|
||||
"net.ipv4.conf.all.secure_redirects" = 0;
|
||||
"net.ipv4.conf.default.secure_redirects" = 0;
|
||||
"net.ipv6.conf.all.accept_redirects" = 0;
|
||||
"net.ipv6.conf.default.accept_redirects" = 0;
|
||||
# Protects against SYN flood attacks
|
||||
"net.ipv4.tcp_syncookies" = 1;
|
||||
# Incomplete protection again TIME-WAIT assassination
|
||||
"net.ipv4.tcp_rfc1337" = 1;
|
||||
|
||||
## TCP optimization
|
||||
# Enable TCP Fast Open for incoming and outgoing connections
|
||||
"net.ipv4.tcp_fastopen" = 3;
|
||||
# Bufferbloat mitigations + slight improvement in throughput & latency
|
||||
"net.ipv4.tcp_congestion_control" = "bbr";
|
||||
"net.core.default_qdisc" = "cake";
|
||||
};
|
||||
kernelModules = ["tcp_bbr"];
|
||||
};
|
||||
|
||||
user.initialPassword = "nixos";
|
||||
users.users.root.initialPassword = "nixos";
|
||||
|
||||
security = {
|
||||
# Prevent replacing the running kernel w/o reboot
|
||||
protectKernelImage = true;
|
||||
# Allows unautherized applications -> send unautherization request
|
||||
polkit.enable = true;
|
||||
rtkit.enable = true;
|
||||
};
|
||||
|
||||
networking.firewall.enable = false;
|
||||
} // (mkIf cfg.useDoas {
|
||||
security.sudo.enable = false;
|
||||
security.doas.enable = true;
|
||||
security.doas.extraRules = [
|
||||
{ users = [ config.user.name ]; noPass = true; persist = false; keepEnv = true; }
|
||||
];
|
||||
environment.systemPackages = with pkgs; [ doas-sudo-shim ];
|
||||
});
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.software.dev.git;
|
||||
in {
|
||||
options.modules.software.dev.git = {
|
||||
enable = mkEnableOption "Enable git. You know what git is";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hm.programs.git = {
|
||||
enable = true;
|
||||
package = pkgs.gitFull;
|
||||
|
||||
userName = ''Jill "oatmealine" Monoids'';
|
||||
userEmail = "oatmealine@disroot.org";
|
||||
|
||||
ignores = [
|
||||
# General:
|
||||
"*.bloop"
|
||||
"*.bsp"
|
||||
"*.metals"
|
||||
"*.metals.sbt"
|
||||
"*metals.sbt"
|
||||
"*.direnv"
|
||||
"*.envrc"
|
||||
"*hie.yaml"
|
||||
"*.mill-version"
|
||||
"*.jvmopts"
|
||||
|
||||
# OS-related:
|
||||
".DS_Store?"
|
||||
".DS_Store"
|
||||
".CFUserTextEncoding"
|
||||
".Trash"
|
||||
".Xauthority"
|
||||
"thumbs.db"
|
||||
"Thumbs.db"
|
||||
"Icon?"
|
||||
];
|
||||
|
||||
aliases = {
|
||||
# Data Analysis:
|
||||
ranked-authors = "!git authors | sort | uniq -c | sort -n";
|
||||
emails = ''
|
||||
!git log --format="%aE" | sort -u
|
||||
'';
|
||||
email-domains = ''
|
||||
!git log --format="%aE" | awk -F'@' '{print $2}' | sort -u
|
||||
'';
|
||||
graph = ''
|
||||
log --graph --color --pretty=format:"%C(yellow)%H%C(green)%d%C(reset)%n%x20%cd%n%x20%cn%x20(%ce)%n%x20%s%n"
|
||||
'';
|
||||
};
|
||||
|
||||
extraConfig = {
|
||||
push.autoSetupRemote = true;
|
||||
pull.rebase = true;
|
||||
init.defaultBranch = "main";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.software.distractions.discord;
|
||||
in {
|
||||
options.modules.software.distractions.discord = {
|
||||
enable = mkEnableOption "Enable Discord, a social messaging app";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
user.packages = let
|
||||
flags =
|
||||
[
|
||||
"--flag-switches-begin"
|
||||
"--flag-switches-end"
|
||||
"--disable-gpu-memory-buffer-video-frames"
|
||||
"--enable-accelerated-mjpeg-decode"
|
||||
"--enable-accelerated-video"
|
||||
"--enable-gpu-rasterization"
|
||||
"--enable-native-gpu-memory-buffers"
|
||||
"--enable-zero-copy"
|
||||
"--ignore-gpu-blocklist"
|
||||
"--disable-features=UseOzonePlatform"
|
||||
"--enable-features=VaapiVideoDecoder"
|
||||
];
|
||||
discord = (pkgs.unstable.discord-canary.override {
|
||||
withOpenASAR = true;
|
||||
withVencord = true;
|
||||
}).overrideAttrs (old: {
|
||||
preInstall = ''
|
||||
gappsWrapperArgs+=("--add-flags" "${concatStringsSep " " flags}")
|
||||
'';
|
||||
});
|
||||
in [ discord ];
|
||||
};
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.software.distractions.steam;
|
||||
in {
|
||||
options.modules.software.distractions.steam = {
|
||||
enable = mkEnableOption "Enable Steam, the game distribution software";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.steam.enable = true;
|
||||
# https://github.com/FeralInteractive/gamemode
|
||||
programs.gamemode = {
|
||||
enable = true;
|
||||
enableRenice = true;
|
||||
settings = {};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,17 +1,33 @@
|
|||
{ lib, config, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.microColors;
|
||||
name = "generated";
|
||||
cfg = config.modules.software.editors.micro;
|
||||
in {
|
||||
options.microColors = {
|
||||
enable = mkEnableOption "Enable shell color config";
|
||||
options.modules.software.editors.micro = {
|
||||
enable = mkEnableOption "Enable micro, the simple command-line code editor";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.micro.settings.colorScheme = name;
|
||||
home.file.".config/micro/colorschemes/${name}.micro".text = with config.colorScheme.colors; ''
|
||||
config = let
|
||||
schemeName = "generated";
|
||||
in mkIf cfg.enable {
|
||||
environment.variables.EDITOR = "micro";
|
||||
|
||||
hm.programs.micro = {
|
||||
enable = true;
|
||||
settings = {
|
||||
autosu = true;
|
||||
clipboard = "terminal";
|
||||
savecursor = true;
|
||||
scrollbar = true;
|
||||
tabsize = 2;
|
||||
tabstospaces = true;
|
||||
|
||||
colorScheme = schemeName;
|
||||
};
|
||||
};
|
||||
|
||||
hm.home.file.".config/micro/colorschemes/${schemeName}.micro".text = with config.colorScheme.colors; ''
|
||||
color-link default "#${base05},#${base00}"
|
||||
color-link comment "#${base03},#${base00}"
|
||||
color-link identifier "#${base0D},#${base00}"
|
|
@ -0,0 +1,60 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.software.editors.vscode;
|
||||
in {
|
||||
options.modules.software.editors.vscode = {
|
||||
enable = mkEnableOption "Enable VSCode, Microsoft's GUI code editor";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hm.programs.vscode = {
|
||||
enable = true;
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
jnoortheen.nix-ide
|
||||
sumneko.lua
|
||||
ms-vsliveshare.vsliveshare
|
||||
];
|
||||
mutableExtensionsDir = false;
|
||||
enableExtensionUpdateCheck = false;
|
||||
enableUpdateCheck = false;
|
||||
userSettings = with config.modules.desktop.fonts.fonts; {
|
||||
"editor.fontFamily" = "'${monospace.family}', monospace";
|
||||
"editor.fontSize" = monospace.size + 3; # no clue why i have to do this
|
||||
|
||||
"terminal.integrated.fontFamily" = "\"${monospace.family}\"";
|
||||
"terminal.integrated.fontSize" = monospace.size + 3;
|
||||
|
||||
"telemetry.enableTelemetry" = false;
|
||||
|
||||
"editor.tabSize" = 2;
|
||||
"editor.cursorSmoothCaretAnimation" = "on";
|
||||
|
||||
"window.dialogStyle" = "custom";
|
||||
"window.titleBarStyle" = "custom";
|
||||
|
||||
"workbench.tips.enabled" = false;
|
||||
"workbench.colorTheme" = "Catppuccin Mocha";
|
||||
|
||||
"nix.enableLanguageServer" = true;
|
||||
"nix.serverPath" = "${lib.getExe pkgs.nil}";
|
||||
|
||||
"security.workspace.trust.untrustedFiles" = "open";
|
||||
|
||||
"explorer.confirmDelete" = false;
|
||||
"explorer.confirmDragAndDrop" = false;
|
||||
|
||||
"editor.bracketPairColorization.enabled" = false;
|
||||
"editor.smoothScrolling" = true;
|
||||
"editor.wordWrap" = "on";
|
||||
"editor.wrappingStrategy" = "advanced";
|
||||
"editor.fontWeight" = "normal";
|
||||
"editor.semanticHighlighting.enabled" = true;
|
||||
|
||||
# prevent VSCode from modifying the terminal colors
|
||||
"terminal.integrated.minimumContrastRatio" = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.hardware.pipewire;
|
||||
in {
|
||||
options.modules.hardware.pipewire = {
|
||||
enable = mkEnableOption "Enable pipewire, a modern audio server";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Enable sound with pipewire.
|
||||
sound.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.software.system.alacritty;
|
||||
in {
|
||||
options.modules.software.system.alacritty = {
|
||||
enable = mkEnableOption "Enable Alacritty, an OpenGL terminal emulator";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hm.programs.alacritty = {
|
||||
enable = true;
|
||||
# custom settings
|
||||
settings = {
|
||||
env.TERM = "xterm-256color";
|
||||
window.resize_increments = true;
|
||||
colors.draw_bold_text_with_bright_colors = true;
|
||||
font = with config.modules.desktop.fonts.fonts.monospaceBitmap; {
|
||||
normal = { inherit family; };
|
||||
inherit size;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.software.system.fish;
|
||||
nix-colors-lib = inputs.nix-colors.lib.contrib { inherit pkgs; };
|
||||
in {
|
||||
options.modules.software.system.fish = {
|
||||
enable = mkEnableOption "Enable fish, the friendly interpreted shell";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
user.packages = [ pkgs.grc ];
|
||||
|
||||
users.defaultUserShell = pkgs.fish;
|
||||
programs.fish.enable = true;
|
||||
hm.programs.fish = let
|
||||
colorScript = nix-colors-lib.shellThemeFromScheme { scheme = config.colorScheme; };
|
||||
in {
|
||||
enable = true;
|
||||
plugins = [ { name = "grc"; src = pkgs.fishPlugins.grc.src; } ];
|
||||
interactiveShellInit = ''
|
||||
sh ${colorScript}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.software.system.syncthing;
|
||||
in {
|
||||
options.modules.software.system.syncthing = {
|
||||
enable = mkEnableOption "Enable Syncthing, a file synchronization server";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# todo: declare sync folders & devices here
|
||||
hm.services.syncthing.enable = true;
|
||||
hm.services.syncthing.tray.enable = true;
|
||||
};
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.software.tools.noisetorch;
|
||||
in {
|
||||
options.modules.software.tools.noisetorch = {
|
||||
enable = mkEnableOption "Enable noisetorch, a microphone noise supression tool";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.noisetorch.enable = true;
|
||||
};
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.software.tools.rbw;
|
||||
in {
|
||||
options.modules.software.tools.rbw = {
|
||||
enable = mkEnableOption "Enable rbw, a Bitwarden CLI password manager";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hm.programs.rbw = let
|
||||
passwordPath = "/home/oatmealine/sync/secrets/bitwardenpass-raw";
|
||||
# thank you, random site i found with google
|
||||
# https://fossies.org/linux/gnupg/tests/fake-pinentries/fake-pinentry.sh
|
||||
getPassword = pkgs.writeShellScriptBin "get-bw-password" ''
|
||||
echo "OK ready"
|
||||
while read cmd rest; do
|
||||
cmd=$(printf "%s" "$cmd" | tr 'A-Z' 'a-z')
|
||||
if [ -z "$cmd" ]; then
|
||||
continue;
|
||||
fi
|
||||
case "$cmd" in
|
||||
\#*)
|
||||
;;
|
||||
getpin)
|
||||
echo "D $(cat ${passwordPath})"
|
||||
echo "OK"
|
||||
;;
|
||||
bye)
|
||||
echo "OK"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "OK"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
'';
|
||||
in {
|
||||
enable = true;
|
||||
settings.base_url = "https://bitwarden.lavatech.top";
|
||||
settings.email = "oatmealine@disroot.org";
|
||||
settings.lock_timeout = 60 * 60 * 24 * 7; # 1 week
|
||||
settings.pinentry = getPassword.overrideAttrs (old: { binaryPath = "bin/get-bw-password"; });
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
# Assumes a single-user setup
|
||||
|
||||
{ config, pkgs, lib, options, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.my;
|
||||
{
|
||||
options = {
|
||||
user = mkOpt types.attrs {};
|
||||
};
|
||||
|
||||
config = {
|
||||
user = rec {
|
||||
name = "oatmealine";
|
||||
description = "Primary user account";
|
||||
extraGroups = ["wheel" "input" "audio" "video" "storage"];
|
||||
isNormalUser = true;
|
||||
home = "/home/${name}";
|
||||
group = name;
|
||||
uid = 1000;
|
||||
};
|
||||
users.groups.${config.user.group} = {};
|
||||
|
||||
users.users.${config.user.name} = mkAliasDefinitions options.user;
|
||||
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
hm.home.username = config.user.name;
|
||||
hm.home.homeDirectory = lib.mkForce config.user.home;
|
||||
|
||||
nix.settings = let
|
||||
users = ["root" config.user.name];
|
||||
in {
|
||||
trusted-users = users;
|
||||
allowed-users = users;
|
||||
};
|
||||
|
||||
users.users.root = {
|
||||
packages = [ pkgs.shadow ];
|
||||
shell = pkgs.shadow;
|
||||
hashedPassword = "!";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
{ ... }:
|
||||
{
|
||||
config = {
|
||||
hm.xdg.enable = true;
|
||||
hm.xdg.userDirs = {
|
||||
enable = true;
|
||||
createDirectories = true;
|
||||
|
||||
desktop = "$HOME/desktop";
|
||||
documents = "$HOME/documents";
|
||||
download = "$HOME/downloads";
|
||||
music = "$HOME/music";
|
||||
pictures = "$HOME/pictures";
|
||||
publicShare = "$HOME/public";
|
||||
templates = "$HOME/templates";
|
||||
videos = "$HOME/videos";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,84 +0,0 @@
|
|||
{ config, pkgs, inputs, outputs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
inputs.hardware.nixosModules.common-cpu-intel
|
||||
inputs.hardware.nixosModules.common-pc-laptop-ssd
|
||||
inputs.hardware.nixosModules.common-pc-laptop
|
||||
./lenovo-thinkpad-x1-1st-gen.nix
|
||||
|
||||
./hardware-configuration.nix
|
||||
|
||||
outputs.nixosModules.gnome
|
||||
|
||||
./security.nix
|
||||
./users.nix
|
||||
./software.nix
|
||||
./wireguard.nix
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nixpkgs.config.allowAliases = false;
|
||||
nix.settings = {
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
auto-optimise-store = true;
|
||||
substituters =
|
||||
[ "https://nix-community.cachix.org" "https://devenv.cachix.org" ];
|
||||
trusted-public-keys = [
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
|
||||
];
|
||||
};
|
||||
nixpkgs.overlays = [
|
||||
outputs.overlays.additions
|
||||
outputs.overlays.unstable-packages
|
||||
outputs.overlays.dynamic-triple-buffering
|
||||
];
|
||||
|
||||
# Bootloader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
networking.hostName = "goop-drive"; # Define your hostname.
|
||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
|
||||
# Enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/Moscow";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_GB.UTF-8";
|
||||
|
||||
# Configure keymap in X11
|
||||
services.xserver = {
|
||||
layout = "us";
|
||||
xkbVariant = "workman";
|
||||
};
|
||||
console.useXkbConfig = true;
|
||||
|
||||
# Prefer tlp over Gnome's power-profiles-daemon
|
||||
#services.power-profiles-daemon.enable = false;
|
||||
#services.tlp.enable = true;
|
||||
|
||||
# Enable CUPS to print documents.
|
||||
#services.printing.enable = false;
|
||||
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
# programs.mtr.enable = true;
|
||||
# programs.gnupg.agent = {
|
||||
# enable = true;
|
||||
# enableSSHSupport = true;
|
||||
# };
|
||||
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||
# this value at the release version of the first install of this system.
|
||||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "23.11"; # Did you read the comment?
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
{
|
||||
security.sudo.enable = false;
|
||||
security.doas.enable = true;
|
||||
security.doas.extraRules = [
|
||||
{ users = [ "oatmealine" ]; noPass = true; persist = false; keepEnv = true; }
|
||||
];
|
||||
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
networking.firewall.enable = false;
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
# Enable sound with pipewire.
|
||||
sound.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
};
|
||||
|
||||
gnome = {
|
||||
enable = true;
|
||||
wayland = false;
|
||||
};
|
||||
|
||||
programs.fish.enable = true;
|
||||
users.defaultUserShell = pkgs.fish;
|
||||
programs.steam.enable = true;
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
micro
|
||||
git
|
||||
curl
|
||||
wget
|
||||
doas
|
||||
catppuccin-gtk
|
||||
home-manager
|
||||
wireguard-tools
|
||||
];
|
||||
|
||||
environment.variables.EDITOR = "micro";
|
||||
|
||||
fonts.packages = with pkgs; [
|
||||
corefonts
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
twitter-color-emoji
|
||||
liberation_ttf
|
||||
fira-code
|
||||
fira-code-symbols
|
||||
mplus-outline-fonts.githubRelease
|
||||
dina-font
|
||||
proggyfonts
|
||||
atkinson-hyperlegible
|
||||
cozette
|
||||
];
|
||||
|
||||
services.flatpak.enable = true;
|
||||
programs.noisetorch.enable = true;
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
users.users.oatmealine = {
|
||||
isNormalUser = true;
|
||||
description = "jill";
|
||||
extraGroups = [ "networkmanager" "wheel" ];
|
||||
};
|
||||
|
||||
users.users.root = {
|
||||
packages = [ pkgs.shadow ];
|
||||
shell = pkgs.shadow;
|
||||
hashedPassword = "!";
|
||||
};
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
{inputs, ...}: {
|
||||
# This one brings our custom packages from the 'pkgs' directory
|
||||
additions = final: _prev: import ../pkgs {pkgs = final;};
|
||||
|
||||
# When applied, the unstable nixpkgs set (declared in the flake inputs) will
|
||||
# be accessible through 'pkgs.unstable'
|
||||
unstable-packages = final: _prev: {
|
||||
unstable = import inputs.nixpkgs-unstable {
|
||||
system = final.system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
};
|
||||
|
||||
dynamic-triple-buffering = (final: prev: {
|
||||
gnome = prev.gnome.overrideScope' (gnomeFinal: gnomePrev: {
|
||||
mutter = gnomePrev.mutter.overrideAttrs ( old: {
|
||||
src = prev.fetchgit {
|
||||
url = "https://gitlab.gnome.org/vanvugt/mutter.git";
|
||||
# GNOME 45: triple-buffering-v4-45
|
||||
rev = "0b896518b2028d9c4d6ea44806d093fd33793689";
|
||||
sha256 = "sha256-mzNy5GPlB2qkI2KEAErJQzO//uo8yO0kPQUwvGDwR4w=";
|
||||
};
|
||||
} );
|
||||
});
|
||||
});
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
final: prev: {
|
||||
gnome = prev.gnome.overrideScope' (gnomeFinal: gnomePrev: {
|
||||
mutter = gnomePrev.mutter.overrideAttrs ( old: {
|
||||
src = prev.fetchgit {
|
||||
url = "https://gitlab.gnome.org/vanvugt/mutter.git";
|
||||
# GNOME 45: triple-buffering-v4-45
|
||||
rev = "0b896518b2028d9c4d6ea44806d093fd33793689";
|
||||
sha256 = "sha256-mzNy5GPlB2qkI2KEAErJQzO//uo8yO0kPQUwvGDwR4w=";
|
||||
};
|
||||
} );
|
||||
});
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
# Custom packages, that can be defined similarly to ones from nixpkgs
|
||||
# You can build them using 'nix build .#example'
|
||||
pkgs: {
|
||||
# example = pkgs.callPackage ./example { };
|
||||
}
|
Loading…
Reference in New Issue