This commit is contained in:
Dmitriy Kholkin 2023-01-26 02:12:00 +03:00
parent 5b06263044
commit 430e2aaa99
15 changed files with 38 additions and 173 deletions

142
flake.lock generated
View File

@ -108,29 +108,6 @@
"type": "gitlab" "type": "gitlab"
} }
}, },
"comma": {
"inputs": {
"flake-compat": "flake-compat",
"naersk": "naersk",
"nixpkgs": [
"nixpkgs"
],
"utils": "utils"
},
"locked": {
"lastModified": 1670543350,
"narHash": "sha256-JMYwGa2nJPInuVuYbR3XSGUJewTDyeoTDQaALydduko=",
"owner": "nix-community",
"repo": "comma",
"rev": "1b07c19774129ebce3af846fb571e1c0b97f24a3",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "comma",
"type": "github"
}
},
"crane": { "crane": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -170,31 +147,6 @@
} }
}, },
"devshell": { "devshell": {
"inputs": {
"flake-utils": [
"direnv-vscode",
"flake-utils"
],
"nixpkgs": [
"direnv-vscode",
"nixpkgs"
]
},
"locked": {
"lastModified": 1671489820,
"narHash": "sha256-qoei5HDJ8psd1YUPD7DhbHdhLIT9L2nadscp4Qk37uk=",
"owner": "numtide",
"repo": "devshell",
"rev": "5aa3a8039c68b4bf869327446590f4cdf90bb634",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"devshell_2": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1663445644, "lastModified": 1663445644,
@ -210,30 +162,6 @@
"type": "github" "type": "github"
} }
}, },
"direnv-vscode": {
"inputs": {
"devshell": "devshell",
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
],
"npmlock2nix": "npmlock2nix"
},
"locked": {
"lastModified": 1673358096,
"narHash": "sha256-A2nS0ruQwoldc0OBPay6NSJ0JXdrsauCFigNau4ZOno=",
"owner": "direnv",
"repo": "direnv-vscode",
"rev": "497bc6a9b0e9474e763d5253da4e1cb0b5ca2466",
"type": "github"
},
"original": {
"owner": "direnv",
"repo": "direnv-vscode",
"type": "github"
}
},
"dream2nix": { "dream2nix": {
"inputs": { "inputs": {
"alejandra": "alejandra", "alejandra": "alejandra",
@ -355,22 +283,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_5": {
"flake": false,
"locked": {
"lastModified": 1668681692,
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
@ -1052,7 +964,7 @@
}, },
"nixpkgs-wayland": { "nixpkgs-wayland": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_4", "flake-compat": "flake-compat_3",
"lib-aggregate": "lib-aggregate", "lib-aggregate": "lib-aggregate",
"nix-eval-jobs": "nix-eval-jobs", "nix-eval-jobs": "nix-eval-jobs",
"nixpkgs": [ "nixpkgs": [
@ -1169,22 +1081,6 @@
"type": "github" "type": "github"
} }
}, },
"npmlock2nix": {
"flake": false,
"locked": {
"lastModified": 1670666882,
"narHash": "sha256-hoCm6Z6fXuYML+gh+HISsRVPMXDmyknAWlaentg9zcc=",
"owner": "nix-community",
"repo": "npmlock2nix",
"rev": "cc11d791fdc3afb2ae7c2f11e10abf7c33b40763",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "npmlock2nix",
"type": "github"
}
},
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1673466346, "lastModified": 1673466346,
@ -1288,7 +1184,7 @@
"base16": "base16", "base16": "base16",
"base16-tokyonight-scheme": "base16-tokyonight-scheme", "base16-tokyonight-scheme": "base16-tokyonight-scheme",
"deploy-rs": "deploy-rs", "deploy-rs": "deploy-rs",
"flake-compat": "flake-compat_3", "flake-compat": "flake-compat_2",
"flake-registry": "flake-registry", "flake-registry": "flake-registry",
"flake-utils-plus": "flake-utils-plus_2", "flake-utils-plus": "flake-utils-plus_2",
"home-manager": "home-manager", "home-manager": "home-manager",
@ -1352,12 +1248,12 @@
"simple-nixos-mailserver": { "simple-nixos-mailserver": {
"inputs": { "inputs": {
"blobs": "blobs", "blobs": "blobs",
"flake-compat": "flake-compat_5", "flake-compat": "flake-compat_4",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
"nixpkgs-22_11": "nixpkgs-22_11", "nixpkgs-22_11": "nixpkgs-22_11",
"utils": "utils_5" "utils": "utils_4"
}, },
"locked": { "locked": {
"lastModified": 1671738303, "lastModified": 1671738303,
@ -1374,36 +1270,6 @@
} }
}, },
"utils": { "utils": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"utils_2": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"utils_3": {
"locked": { "locked": {
"lastModified": 1667395993, "lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",

View File

@ -55,7 +55,7 @@
url = "github:nix-community/nixos-generators"; url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nur.url = github:nix-community/NUR; nur.url = "github:nix-community/NUR";
qbittorrent-ee = { qbittorrent-ee = {
url = "github:c0re100/qBittorrent-Enhanced-Edition"; url = "github:c0re100/qBittorrent-Enhanced-Edition";
flake = false; flake = false;
@ -112,7 +112,7 @@
findModules (dir + "/${name}")) findModules (dir + "/${name}"))
(builtins.readDir dir))); (builtins.readDir dir)));
patchesPath = (patches: map (x: ./patches + "/${x}") patches); patchesPath = map (x: ./patches + "/${x}");
in flake-utils-plus.lib.mkFlake rec { in flake-utils-plus.lib.mkFlake rec {
inherit self inputs; inherit self inputs;
supportedSystems = [ "x86_64-linux" ]; supportedSystems = [ "x86_64-linux" ];
@ -180,7 +180,7 @@
name = "aliases"; name = "aliases";
packages = with pkgs; [ packages = with pkgs; [
rebuild update-vscode upgrade upgrade-hyprland rebuild update-vscode upgrade upgrade-hyprland
nixfmt nixpkgs-fmt statix nixfmt nixpkgs-fmt statix vulnix deadnix
]; ];
}; };
packages = { packages = {

View File

@ -30,27 +30,27 @@ with types; {
isLaptop = mkOption { isLaptop = mkOption {
type = bool; type = bool;
default = default =
!isNull (builtins.match ".*Laptop" config.networking.hostName); (builtins.match ".*Laptop" config.networking.hostName) != null;
}; };
isVM = mkOption { isVM = mkOption {
type = bool; type = bool;
default = default =
!isNull (builtins.match ".*VM" config.networking.hostName); (builtins.match ".*VM" config.networking.hostName) != null;
}; };
isServer = mkOption { isServer = mkOption {
type = bool; type = bool;
default = default =
!isNull (builtins.match ".*(Cloud|Server)" config.networking.hostName); (builtins.match ".*(Cloud|Server)" config.networking.hostName) != null;
}; };
isContainer = mkOption { isContainer = mkOption {
type = bool; type = bool;
default = default =
!isNull (builtins.match ".*(CT|Container)" config.networking.hostName); (builtins.match ".*(CT|Container)" config.networking.hostName) != null;
}; };
isISO = mkOption { isISO = mkOption {
type = bool; type = bool;
default = default =
!isNull (builtins.match ".*ISO" config.networking.hostName); (builtins.match ".*ISO" config.networking.hostName) != null;
}; };
isDesktop = mkOption { isDesktop = mkOption {
type = bool; type = bool;

View File

@ -56,7 +56,7 @@ in {
}; };
config.systemd.tmpfiles.rules = config.systemd.tmpfiles.rules =
mapAttrsToList (tmpfileEntry) cfg.sharedMemoryFiles; mapAttrsToList tmpfileEntry cfg.sharedMemoryFiles;
config.boot.kernelParams = optionals cfg.hugepages.enable [ config.boot.kernelParams = optionals cfg.hugepages.enable [
"default_hugepagesz=${cfg.hugepages.defaultPageSize}" "default_hugepagesz=${cfg.hugepages.defaultPageSize}"

View File

@ -28,7 +28,7 @@ let
}; };
permissions = mkOption { permissions = mkOption {
type = lib.types.addCheck lib.types.str type = lib.types.addCheck lib.types.str
(perm: !isNull (builtins.match "[0-7]{3}" perm)); (perm: (builtins.match "[0-7]{3}" perm) != null);
default = "400"; default = "400";
}; };
services = mkOption { services = mkOption {
@ -43,7 +43,7 @@ let
}; };
exportSecrets = name: cfg: exportSecrets = name: cfg:
let prefix = lib.optionalString (!isNull cfg.prefix) "${cfg.prefix}_"; let prefix = lib.optionalString (cfg.prefix != null) "${cfg.prefix}_";
in map (secret: in map (secret:
'' ''
export ${prefix}${secret}="$(cat ${ export ${prefix}${secret}="$(cat ${
@ -98,7 +98,7 @@ let
map (x: { map (x: {
"${name}-envsubst-${x}" = { "${name}-envsubst-${x}" = {
encrypted = "${config.home-manager.users.${config.mainuser}.xdg.dataHome}/password-store/${ encrypted = "${config.home-manager.users.${config.mainuser}.xdg.dataHome}/password-store/${
lib.optionalString (!isNull cfg.directory) "${cfg.directory}/" lib.optionalString (cfg.directory != null) "${cfg.directory}/"
}${x}.gpg"; }${x}.gpg";
services = [ ]; services = [ ];
}; };

View File

@ -33,7 +33,7 @@ let
}; };
permissions = mkOption { permissions = mkOption {
type = lib.types.addCheck lib.types.str type = lib.types.addCheck lib.types.str
(perm: !isNull (builtins.match "[0-7]{3}" perm)); (perm: (builtins.match "[0-7]{3}" perm) != null);
default = "400"; default = "400";
}; };
services = mkOption { services = mkOption {
@ -112,10 +112,10 @@ let
mkServices = name: cfg: [ (decrypt name cfg) (addDependencies name cfg) ]; mkServices = name: cfg: [ (decrypt name cfg) (addDependencies name cfg) ];
allServicesMap = (map (name: "${name}-envsubst.service") allServicesMap = map (name: "${name}-envsubst.service")
(builtins.attrNames config.secrets-envsubst) (builtins.attrNames config.secrets-envsubst)
++ map (name: "${name}-secrets.service") ++ map (name: "${name}-secrets.service")
(builtins.attrNames config.secrets)); (builtins.attrNames config.secrets);
allServices = toString allServicesMap; allServices = toString allServicesMap;

View File

@ -2,7 +2,7 @@
home-manager.users.${config.mainuser} = { home-manager.users.${config.mainuser} = {
programs.nnn = { programs.nnn = {
enable = true; enable = true;
package = pkgs.nnn.override ({ withNerdIcons = true; }); package = pkgs.nnn.override { withNerdIcons = true; };
# extraPackages = with pkgs; [ ffmpegthumbnailer mediainfo sxiv ]; # extraPackages = with pkgs; [ ffmpegthumbnailer mediainfo sxiv ];
# bookmarks = { # bookmarks = {
# d = "~/Documents"; # d = "~/Documents";

View File

@ -1,14 +1,14 @@
{ pkgs, config, lib, inputs, ... }: { pkgs, config, lib, inputs, ... }:
let let
inherit (pkgs.hostPlatform) system; inherit (pkgs.hostPlatform) system;
master = import inputs.nixpkgs-master ({ master = import inputs.nixpkgs-master {
config = config.nixpkgs.config; config = config.nixpkgs.config;
localSystem = { inherit system; }; localSystem = { inherit system; };
}); };
stable = import inputs.nixpkgs-stable ({ stable = import inputs.nixpkgs-stable {
config = config.nixpkgs.config; config = config.nixpkgs.config;
localSystem = { inherit system; }; localSystem = { inherit system; };
}); };
roundcube-plugins = import ./packages/roundcube-plugins/default.nix; roundcube-plugins = import ./packages/roundcube-plugins/default.nix;
in in
with lib; { with lib; {

View File

@ -50,9 +50,7 @@ let
# cp -r ${release}/po ./ # cp -r ${release}/po ./
# chmod 644 -R ./po # chmod 644 -R ./po
in ( in assert efiSupport -> canEfi;
assert efiSupport -> canEfi;
assert zfsSupport -> zfs != null; assert zfsSupport -> zfs != null;
assert !(efiSupport && xenSupport); assert !(efiSupport && xenSupport);
@ -191,4 +189,4 @@ stdenv.mkDerivation rec {
maintainers = [ maintainers.samueldr ]; maintainers = [ maintainers.samueldr ];
}; };
}) }

View File

@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
]; ];
meta = with lib; { meta = with lib; {
homepage = https://github.com/haiwen/seadrive-fuse; homepage = "https://github.com/haiwen/seadrive-fuse";
description = "SeaDrive daemon with FUSE interface"; description = "SeaDrive daemon with FUSE interface";
license = licenses.gpl3; license = licenses.gpl3;
platforms = platforms.all; platforms = platforms.all;

View File

@ -1,9 +1,5 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let with config.virtualisation.oci-containers; {
# init = pkgs.writeScript "init.sh" ''
# CHANGEME
# '';
in with config.virtualisation.oci-containers; {
virtualisation.oci-containers.containers.stable-diffusion = { virtualisation.oci-containers.containers.stable-diffusion = {
# autoStart = true; # autoStart = true;
autoStart = false; autoStart = false;

View File

@ -2,9 +2,9 @@
home-manager.users.${config.mainuser} = { home-manager.users.${config.mainuser} = {
xdg.configFile = { xdg.configFile = {
"easyeffects/output/HE4XX.json".text = "easyeffects/output/HE4XX.json".text =
(builtins.readFile ./HE4XX.json); builtins.readFile ./HE4XX.json;
"easyeffects/output/Bluetooth.json".text = "easyeffects/output/Bluetooth.json".text =
(builtins.readFile ./Bluetooth.json); builtins.readFile ./Bluetooth.json;
}; };
services.easyeffects.enable = true; services.easyeffects.enable = true;
}; };

View File

@ -54,7 +54,7 @@ with config.deviceSpecific; {
virtualisation.lxd = lib.mkIf (!isContainer) { virtualisation.lxd = lib.mkIf (!isContainer) {
enable = true; enable = true;
zfsSupport = (devInfo.fileSystem == "zfs"); zfsSupport = devInfo.fileSystem == "zfs";
recommendedSysctlSettings = true; recommendedSysctlSettings = true;
}; };
virtualisation.lxc = lib.mkIf (!isContainer) { virtualisation.lxc = lib.mkIf (!isContainer) {

View File

@ -17,7 +17,7 @@
} }
{ {
keys = [ 431 ]; keys = [ 431 ];
command = (toString (pkgs.writeTextFile { command = toString (pkgs.writeTextFile {
name = "dark-script"; name = "dark-script";
text = '' text = ''
if [[ `${pkgs.light}/bin/light` -eq 0 ]] if [[ `${pkgs.light}/bin/light` -eq 0 ]]
@ -28,7 +28,7 @@
${pkgs.light}/bin/light -S 0 ${pkgs.light}/bin/light -S 0
fi''; fi'';
executable = true; executable = true;
})); });
} }
]; ];
}; };

5
statix.toml Normal file
View File

@ -0,0 +1,5 @@
disabled = [
"manual_inherit",
"manual_inherit_from",
"empty_pattern",
]