some updates, moved to zsh

This commit is contained in:
Dmitriy Kholkin 2020-09-08 03:07:50 +04:00
parent 89da7d69df
commit b36fb27499
10 changed files with 125 additions and 68 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
result result
*.bak

61
flake.lock generated
View File

@ -69,6 +69,23 @@
"type": "github" "type": "github"
} }
}, },
"lowdown-src": {
"flake": false,
"locked": {
"lastModified": 1598296217,
"narHash": "sha256-ha7lyNY1d8m+osmDpPc9f/bfZ3ZC1IVIXwfyklSWg8I=",
"owner": "edolstra",
"repo": "lowdown",
"rev": "c7a4e715af1e233080842db82d15b261cb74cb28",
"type": "github"
},
"original": {
"owner": "edolstra",
"ref": "no-structs-in-anonymous-unions",
"repo": "lowdown",
"type": "github"
}
},
"materia-theme": { "materia-theme": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -87,21 +104,20 @@
}, },
"nix": { "nix": {
"inputs": { "inputs": {
"lowdown-src": "lowdown-src",
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1593628299, "lastModified": 1599125415,
"narHash": "sha256-TG05BV4fbJdDW4RzoYBYaGdFtOq6NNet1JHjP1Au/VE=", "narHash": "sha256-f5Dx9hfO06239HILkfD3qntrj2EZt8kNAF9NHeAJyoI=",
"owner": "nixos", "owner": "NixOS",
"repo": "nix", "repo": "nix",
"rev": "6ff9aa8df7ce8266147f74c65e2cc529a1e72ce0", "rev": "8a945d6ddb0676b454458e6fe0e9ea6f8b4b5659",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "id": "nix",
"repo": "nix", "type": "indirect"
"rev": "6ff9aa8df7ce8266147f74c65e2cc529a1e72ce0",
"type": "github"
} }
}, },
"nixpkgs": { "nixpkgs": {
@ -135,6 +151,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-old": {
"locked": {
"lastModified": 1596265691,
"narHash": "sha256-9ofCzFqttTsGrvTaS4RrDSTNQO9PFOz5uyn8V+2eA5M=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "840c782d507d60aaa49aa9e3f6d0b0e780912742",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"rev": "840c782d507d60aaa49aa9e3f6d0b0e780912742",
"type": "github"
}
},
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1591748508, "lastModified": 1591748508,
@ -166,11 +198,11 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1596265691, "lastModified": 1597943282,
"narHash": "sha256-9ofCzFqttTsGrvTaS4RrDSTNQO9PFOz5uyn8V+2eA5M=", "narHash": "sha256-G/VQBlqO7YeFOSvn29RqdvABZxmQBtiRYVA6kjqWZ6o=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "840c782d507d60aaa49aa9e3f6d0b0e780912742", "rev": "c59ea8b8a0e7f927e7291c14ea6cd1bd3a16ff38",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -190,6 +222,7 @@
"nix": "nix", "nix": "nix",
"nixpkgs": "nixpkgs_4", "nixpkgs": "nixpkgs_4",
"nixpkgs-mozilla": "nixpkgs-mozilla", "nixpkgs-mozilla": "nixpkgs-mozilla",
"nixpkgs-old": "nixpkgs-old",
"spotify-tui": "spotify-tui", "spotify-tui": "spotify-tui",
"zsh-autosuggestions": "zsh-autosuggestions", "zsh-autosuggestions": "zsh-autosuggestions",
"zsh-nix-shell": "zsh-nix-shell", "zsh-nix-shell": "zsh-nix-shell",
@ -199,11 +232,11 @@
"spotify-tui": { "spotify-tui": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1595589659, "lastModified": 1598962613,
"narHash": "sha256-Jqn27cWY3e7Swpe5zEwhtHaYdJu1+D1k4e6cd2D2fGk=", "narHash": "sha256-jBxXTP014PrLLPPN6O/Lb1nS5uizPgG3GI7gLPDtPk4=",
"owner": "Rigellute", "owner": "Rigellute",
"repo": "spotify-tui", "repo": "spotify-tui",
"rev": "10e8d9e5f9887820f7cff6531357088d44816f86", "rev": "81e357e21826e2b61278175ccd68077febbdc6df",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -3,7 +3,8 @@
inputs = { inputs = {
nixpkgs.url = github:nixos/nixpkgs/nixos-unstable; nixpkgs.url = github:nixos/nixpkgs/nixos-unstable;
nix.url = github:nixos/nix/6ff9aa8df7ce8266147f74c65e2cc529a1e72ce0; nixpkgs-old.url = github:nixos/nixpkgs/840c782d507d60aaa49aa9e3f6d0b0e780912742;
# nix.url = github:nixos/nix/6ff9aa8df7ce8266147f74c65e2cc529a1e72ce0;
home-manager.url = github:rycee/home-manager/bqv-flakes; home-manager.url = github:rycee/home-manager/bqv-flakes;
base16.url = github:alukardbf/base16-nix; base16.url = github:alukardbf/base16-nix;
# base16.url = "/shared/nixos/base16-nix"; # base16.url = "/shared/nixos/base16-nix";

View File

@ -14,23 +14,45 @@
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" =
{ device = "/dev/disk/by-uuid/ac8a1cde-9a8b-4181-acd2-719580160943"; { device = "rpool/system/root";
fsType = "f2fs"; fsType = "zfs";
}; };
boot.initrd.luks.devices."cryptnixos".device = "/dev/disk/by-uuid/5cc91d59-4341-48c8-9e72-a5169b3d9a41"; fileSystems."/nix" =
{ device = "rpool/local/nix";
fsType = "zfs";
};
fileSystems."/var" =
{ device = "rpool/system/var";
fsType = "zfs";
};
fileSystems."/home" =
{ device = "rpool/user/home";
fsType = "zfs";
};
fileSystems."/bittorrent" =
{ device = "rpool/local/bittorrent";
fsType = "zfs";
};
fileSystems."/boot" = fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/7294-A273"; { device = "/dev/disk/by-uuid/A4E5-0229";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = [ swapDevices = [
{ {
device = "/dev/disk/by-partuuid/e979f198-37c4-4a86-8138-e148c3d78447"; device = "/dev/disk/by-partuuid/18c50c59-26f4-4181-944b-cdeabbd731b0";
randomEncryption.enable = true; randomEncryption.enable = true;
} }
]; ];
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
networking.hostId = "60f0b8d8";
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-partuuid/af053f01-4e3d-4163-af49-bfea01bb3dfe";
boot.zfs.devNodes = "/dev/mapper/cryptroot";
boot.supportedFilesystems = [ "zfs" ];
} }

View File

@ -55,7 +55,7 @@ with deviceSpecific; {
spotifywm spotifywm
system-config-printer system-config-printer
tdesktop tdesktop
(vivaldi.override { proprietaryCodecs = true; }) (old.vivaldi.override { proprietaryCodecs = true; })
vscode vscode
xarchiver xarchiver
xfce4-14.thunar xfce4-14.thunar

View File

@ -7,6 +7,22 @@ with deviceSpecific;
# wgEnabled = config.secrets.wireguard.${config.device}.enable; # wgEnabled = config.secrets.wireguard.${config.device}.enable;
# in # in
{ {
services.zfs = {
trim.enable = true;
trim.interval = "weekly";
autoScrub.enable = true;
autoScrub.interval = "weekly";
autoSnapshot = {
enable = true;
frequent = 8;
hourly = 8;
daily = 4;
weekly = 2;
monthly = 2;
};
};
fileSystems = { fileSystems = {
"/shared/nixos" = lib.mkIf isVM { "/shared/nixos" = lib.mkIf isVM {
fsType = "vboxsf"; fsType = "vboxsf";

View File

@ -1,7 +1,12 @@
{ pkgs, config, lib, inputs, ... }: { pkgs, config, lib, inputs, ... }:
# let let
# mozilla_overlay = import inputs.nixpkgs-mozilla; # mozilla_overlay = import inputs.nixpkgs-mozilla;
# in system = "x86_64-linux";
old = import inputs.nixpkgs-old ({
config = config.nixpkgs.config;
localSystem = { inherit system; };
});
in
{ {
nixpkgs.overlays = [ nixpkgs.overlays = [
inputs.nix.overlay inputs.nix.overlay
@ -9,6 +14,7 @@
(self: super: (self: super:
rec { rec {
inherit inputs; inherit inputs;
inherit old;
youtube-to-mpv = pkgs.callPackage ./packages/youtube-to-mpv.nix { term = config.defaultApplications.term.cmd; }; youtube-to-mpv = pkgs.callPackage ./packages/youtube-to-mpv.nix { term = config.defaultApplications.term.cmd; };
@ -88,8 +94,8 @@
''; '';
# TODO: change? # TODO: change?
# package = pkgs.nixFlakes; package = pkgs.nixFlakes;
package = inputs.nix.packages.x86_64-linux.nix; # package = inputs.nix.packages.x86_64-linux.nix;
registry.self.flake = inputs.self; registry.self.flake = inputs.self;
}; };

View File

@ -33,6 +33,6 @@ in fetchzip {
rm -f $out/share/fonts/opentype/IBMPlex* rm -f $out/share/fonts/opentype/IBMPlex*
''; '';
sha256 = "sha256-DaNXraX1gXhoS3Pnttw4VVHRvGrQRR2wuplNJn+c6cg="; sha256 = "sha256-Ur3pG3t9sjboJ2AFAcffFfVJhRQBOtvZ0aulFyMZJts=";
} }

View File

@ -6,44 +6,23 @@ with rec {
with deviceSpecific; { with deviceSpecific; {
services.tlp = { services.tlp = {
enable = isLaptop; enable = isLaptop;
# New settings format in master branch nixpkgs settings = {
# settings = { CPU_SCALING_GOVERNOR_ON_AC = "powersave";
# CPU_SCALING_GOVERNOR_ON_AC = "powersave"; CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
# CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; CPU_HWP_ON_AC = "balance_performance";
# CPU_HWP_ON_AC = "balance_performance"; CPU_HWP_ON_BAT = "balance_power";
# CPU_HWP_ON_BAT = "balance_power"; CPU_BOOST_ON_AC = 1;
# CPU_BOOST_ON_AC = 1; CPU_BOOST_ON_BAT = 0;
# CPU_BOOST_ON_BAT = 0; SCHED_POWERSAVE_ON_AC = 0;
# SCHED_POWERSAVE_ON_AC = 0; SCHED_POWERSAVE_ON_BAT = 1;
# SCHED_POWERSAVE_ON_BAT = 1; CPU_ENERGY_PERF_POLICY_ON_AC = "balance_performance";
# CPU_ENERGY_PERF_POLICY_ON_AC = "balance_performance"; CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_power";
# CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_power"; DISK_DEVICES = "\"nvme0n1 sda\"";
# DISK_DEVICES = "\"nvme0n1 sda\""; DISK_APM_LEVEL_ON_AC = "\"255 254\"";
# DISK_APM_LEVEL_ON_AC = "\"255 254\""; DISK_APM_LEVEL_ON_BAT = "\"255 254\"";
# DISK_APM_LEVEL_ON_BAT = "\"255 254\""; SATA_LINKPWR_ON_BAT = "\"med_power_with_dipm max_performance\"";
# SATA_LINKPWR_ON_BAT = "\"med_power_with_dipm max_performance\""; SATA_LINKPWR_ON_AC = "\"med_power_with_dipm max_performance\"";
# SATA_LINKPWR_ON_AC = "\"med_power_with_dipm max_performance\""; };
# };
extraConfig = ''
# Recommended
CPU_SCALING_GOVERNOR_ON_AC=powersave
CPU_SCALING_GOVERNOR_ON_BAT=powersave
CPU_HWP_ON_AC=balance_performance
CPU_HWP_ON_BAT=balance_power
CPU_BOOST_ON_AC=1
CPU_BOOST_ON_BAT=0
SCHED_POWERSAVE_ON_AC=0
SCHED_POWERSAVE_ON_BAT=1
CPU_ENERGY_PERF_POLICY_ON_AC=balance_performance
CPU_ENERGY_PERF_POLICY_ON_BAT=balance_power
DISK_DEVICES="nvme0n1 sda"
DISK_APM_LEVEL_ON_AC="255 254"
DISK_APM_LEVEL_ON_BAT="255 254"
# To avoid filesystem corruption on btrfs formatted partitions
SATA_LINKPWR_ON_BAT="med_power_with_dipm max_performance"
SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance"
'';
}; };
services.undervolt = lib.mkIf (device == "Dell-Laptop") { services.undervolt = lib.mkIf (device == "Dell-Laptop") {

View File

@ -10,8 +10,7 @@ with config.deviceSpecific; {
}; };
services.earlyoom = { services.earlyoom = {
# enable = device.ram < 16; enable = device.ram < 16;
enable = false;
freeMemThreshold = 5; freeMemThreshold = 5;
freeSwapThreshold = 100; freeSwapThreshold = 100;
}; };