Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
934a07640e |
|||
|
a3b7696382 |
|||
|
be3d0865f4 |
|||
|
f22e33c967 |
|||
|
6b65b1d3fd |
|||
|
f8f309c54b |
|||
|
8a60b5a1c1 |
|||
|
dbc21e11be |
|||
|
482d42cc05 |
|||
|
1dd8c43caa |
7 changed files with 20 additions and 44 deletions
|
|
@ -8,16 +8,10 @@
|
||||||
let
|
let
|
||||||
name = "git";
|
name = "git";
|
||||||
cfg = config.nixowos.defaults.${name};
|
cfg = config.nixowos.defaults.${name};
|
||||||
superCfg = config.programs.${name};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
nixowos.defaults.${name}.enable = lib.mkEnableOption name;
|
nixowos.defaults.${name}.enable = lib.mkEnableOption name;
|
||||||
|
|
||||||
# FIXME: this doesn't really belong in defaults/
|
|
||||||
programs.${name}.delta.enable = lib.mkEnableOption "delta within git" // {
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
@ -34,15 +28,10 @@ in
|
||||||
# causing further problems
|
# causing further problems
|
||||||
pull.ff = "only";
|
pull.ff = "only";
|
||||||
|
|
||||||
merge.conflictStyle = "zdiff3"; # easiest to understand style
|
push.autoSetupRemote = true;
|
||||||
|
|
||||||
commit.verbose = true; # show diffs in commit editor
|
commit.verbose = true; # show diffs in commit editor
|
||||||
}
|
};
|
||||||
// (lib.optionalAttrs (superCfg.delta.enable && config.nixowos.allowAddingPackages) {
|
|
||||||
core.pager = "${lib.getExe pkgs.delta}";
|
|
||||||
interactive.diffFilter = "${lib.getExe pkgs.delta} --color-only";
|
|
||||||
delta.navigate = true; # use n and N to move between diff sections
|
|
||||||
delta.diff-highlight = true; # simpler mode, highlights inter-line changes
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,11 @@ in
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
# use lix, a fork of nix
|
# use lix, a fork of nix
|
||||||
# see: https://lix.systems/about
|
# see: https://lix.systems/about
|
||||||
nix.package = pkgs.lixPackageSets.lix_2_95.lix;
|
nix.package = pkgs.lixPackageSets.latest.lix;
|
||||||
# overlays so that all nix tools use lix
|
# overlays so that all nix tools use lix
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(final: prev: {
|
(final: prev: {
|
||||||
inherit (prev.lixPackageSets.lix_2_95)
|
inherit (prev.lixPackageSets.latest)
|
||||||
nixpkgs-review
|
nixpkgs-review
|
||||||
nix-eval-jobs
|
nix-eval-jobs
|
||||||
nix-fast-build
|
nix-fast-build
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,11 @@ in
|
||||||
# source: https://nix.dev/manual/nix/2.26/command-ref/new-cli/nix3-store-optimise
|
# source: https://nix.dev/manual/nix/2.26/command-ref/new-cli/nix3-store-optimise
|
||||||
nix.settings.auto-optimise-store = true;
|
nix.settings.auto-optimise-store = true;
|
||||||
|
|
||||||
environment.systemPackages =
|
# trigger the garbage collector automatically
|
||||||
with pkgs;
|
# when free space in /nix/store goes below this
|
||||||
lib.mkIf config.nixowos.allowAddingPackages [
|
nix.settings.min-free = 1000000000; # 1GB
|
||||||
nixd
|
# free up to this many bytes in an automatic invocation
|
||||||
nixfmt
|
# to avoid it taking too long
|
||||||
];
|
nix.settings.max-free = 5000000000; # 5GB
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,11 +28,6 @@ in
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
hardware.graphics.enable = true;
|
hardware.graphics.enable = true;
|
||||||
|
|
||||||
fonts = lib.mkIf config.nixowos.allowAddingPackages {
|
|
||||||
enableDefaultPackages = lib.mkDefault true;
|
|
||||||
packages = [ pkgs.noto-fonts-cjk-sans ];
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages =
|
environment.systemPackages =
|
||||||
with pkgs;
|
with pkgs;
|
||||||
lib.mkIf config.nixowos.allowAddingPackages [
|
lib.mkIf config.nixowos.allowAddingPackages [
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,6 @@ in
|
||||||
compsize
|
compsize
|
||||||
|
|
||||||
ffmpeg
|
ffmpeg
|
||||||
|
|
||||||
python3
|
|
||||||
]
|
]
|
||||||
++ (
|
++ (
|
||||||
if config.nixowos.nvidia.enable then
|
if config.nixowos.nvidia.enable then
|
||||||
|
|
@ -40,7 +38,6 @@ in
|
||||||
else
|
else
|
||||||
[
|
[
|
||||||
btop-rocm
|
btop-rocm
|
||||||
nvtopPackages.amd
|
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
@ -50,9 +47,6 @@ in
|
||||||
# use Fish, the nicest shell :)
|
# use Fish, the nicest shell :)
|
||||||
programs.fish.enable = lib.mkIf config.nixowos.allowAddingPackages true;
|
programs.fish.enable = lib.mkIf config.nixowos.allowAddingPackages true;
|
||||||
users.defaultUserShell = lib.mkIf config.nixowos.allowAddingPackages pkgs.fish;
|
users.defaultUserShell = lib.mkIf config.nixowos.allowAddingPackages pkgs.fish;
|
||||||
# avoid generating caches (enabled by fish) due to slowdowns during nixos-rebuild
|
|
||||||
# this may degrade autocompletion
|
|
||||||
documentation.man.generateCaches = false;
|
|
||||||
|
|
||||||
environment.shellAliases = {
|
environment.shellAliases = {
|
||||||
# make nix-shell preserve the user's $SHELL
|
# make nix-shell preserve the user's $SHELL
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
|
|
@ -12,19 +11,10 @@ in
|
||||||
{
|
{
|
||||||
options.nixowos.defaults.${name} = {
|
options.nixowos.defaults.${name} = {
|
||||||
enable = lib.mkEnableOption name;
|
enable = lib.mkEnableOption name;
|
||||||
|
|
||||||
extraPackages = lib.mkOption {
|
|
||||||
type = lib.types.listOf lib.types.package;
|
|
||||||
default = with pkgs; [
|
|
||||||
sshfs
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
environment.systemPackages = lib.mkIf config.nixowos.allowAddingPackages cfg.extraPackages;
|
|
||||||
|
|
||||||
boot.loader.grub = lib.mkDefault {
|
boot.loader.grub = lib.mkDefault {
|
||||||
# modern installation
|
# modern installation
|
||||||
device = "nodev";
|
device = "nodev";
|
||||||
|
|
@ -52,6 +42,9 @@ in
|
||||||
tmpfsHugeMemoryPages = "within_size";
|
tmpfsHugeMemoryPages = "within_size";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# this is useful not only for having a user named "tmp"
|
||||||
|
# but also if any user wants to use a temporary directory,
|
||||||
|
# it's much nicer than /tmp because it isn't filled with system files
|
||||||
fileSystems."/home/tmp" = lib.mkDefault {
|
fileSystems."/home/tmp" = lib.mkDefault {
|
||||||
fsType = "tmpfs";
|
fsType = "tmpfs";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,12 @@ in
|
||||||
# Enable this if you have graphical corruption issues or application crashes after waking
|
# Enable this if you have graphical corruption issues or application crashes after waking
|
||||||
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
|
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
|
||||||
# of just the bare essentials.
|
# of just the bare essentials.
|
||||||
# powerManagement.enable = false;
|
powerManagement.enable = true;
|
||||||
|
# the following is from @tlater:matrix.tlater.net (Lix Off Topic, 2026-06-24)
|
||||||
|
# `powerManagement.enable` maps to this set of NVIDIA driver features: https://download.nvidia.com/XFree86/Linux-x86_64/610.43.02/README/powermanagement.html
|
||||||
|
# You can read through those docs yourself, but tl;dr: modern GPUs have more memory than can normally be stored on suspend, so they need a workaround.
|
||||||
|
# The modern open source drivers can use some cool kernel features that were behind the GPL lock beforehand to achieve that, the proprietary drivers are stuck with a hack. But basically, you always want to enable that option on NixOS.
|
||||||
|
# The `powermanagement.finegrained` stuff on the other hand has to do with multi-GPU setups. The two options should really not be grouped together like this.
|
||||||
|
|
||||||
# Use the NVidia open source kernel module (not to be confused with the
|
# Use the NVidia open source kernel module (not to be confused with the
|
||||||
# independent third-party "nouveau" open source driver).
|
# independent third-party "nouveau" open source driver).
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue