update, patch nix, reformat

This commit is contained in:
Gerg-L 2024-02-14 19:20:35 -05:00
parent 15529d185d
commit 1dfe51881d
Signed by: gerg-l
SSH key fingerprint: SHA256:FPYDHIkvMocr4wdmZXpgpJjsb2Tw6rASs2ISPbOb0KI
9 changed files with 130 additions and 128 deletions

16
flake.lock generated
View file

@ -215,16 +215,16 @@
"nixpkgs-regression": "nixpkgs-regression" "nixpkgs-regression": "nixpkgs-regression"
}, },
"locked": { "locked": {
"lastModified": 1705968297, "lastModified": 1707913978,
"narHash": "sha256-dGmqJW8v1JPAzv50v2u4MdLrIYLiIXVte4M1wJ0ayyA=", "narHash": "sha256-STyfZLkT0Sc6bNkfXVXR8OL0W7LUYHHuw4Bqwhb/Gr0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nix", "repo": "nix",
"rev": "08bf2846df34b0db3a25d575e8cb34a9518a9dcc", "rev": "d857914e1a41670893d6571726588659afe7b1e9",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "08bf2846df34b0db3a25d575e8cb34a9518a9dcc", "ref": "d857914e1a41670893d6571726588659afe7b1e9",
"repo": "nix", "repo": "nix",
"type": "github" "type": "github"
} }
@ -527,16 +527,16 @@
}, },
"unstable": { "unstable": {
"locked": { "locked": {
"lastModified": 1707689078, "lastModified": 1707661179,
"narHash": "sha256-UUGmRa84ZJHpGZ1WZEBEUOzaPOWG8LZ0yPg1pdDF/yM=", "narHash": "sha256-dyJ0nyP+S58WgJVigOboHTE5LR1E7MzJvm3fc9zkza8=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8", "rev": "8686026882afa61d77a6fa5b05a25e4769ee09cd",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-unstable", "ref": "8686026882afa61d77a6fa5b05a25e4769ee09cd",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View file

@ -11,7 +11,8 @@
type = "github"; type = "github";
owner = "NixOS"; owner = "NixOS";
repo = "nixpkgs"; repo = "nixpkgs";
ref = "nixos-unstable"; #ref = "nixos-unstable";
ref = "8686026882afa61d77a6fa5b05a25e4769ee09cd";
}; };
stable = { stable = {
type = "github"; type = "github";
@ -24,7 +25,7 @@
type = "github"; type = "github";
owner = "NixOS"; owner = "NixOS";
repo = "nix"; repo = "nix";
ref = "08bf2846df34b0db3a25d575e8cb34a9518a9dcc"; ref = "d857914e1a41670893d6571726588659afe7b1e9";
inputs.nixpkgs.follows = "stable"; inputs.nixpkgs.follows = "stable";
}; };
nixos-generators = { nixos-generators = {

View file

@ -1,5 +1,5 @@
_: _:
{config, ... }: #{ config, ... }:
{ {
# users.users = { # users.users = {
# ${config.services.gitea.user} = { # ${config.services.gitea.user} = {

View file

@ -17,7 +17,7 @@ _:
adminpassFile = config.sops.secrets.nextcloud.path; adminpassFile = config.sops.secrets.nextcloud.path;
adminuser = "admin-root"; adminuser = "admin-root";
}; };
extraOptions = { settings = {
overwriteprotocol = "https"; overwriteprotocol = "https";
default_phone_region = "US"; default_phone_region = "US";
}; };

View file

@ -9,12 +9,10 @@ _:
"gerg_ssl_key" "gerg_ssl_key"
"gerg_ssl_cert" "gerg_ssl_cert"
] ]
( (_: {
_: {
owner = config.services.nginx.user; owner = config.services.nginx.user;
inherit (config.services.nginx) group; inherit (config.services.nginx) group;
} });
);
services.nginx = { services.nginx = {
enable = true; enable = true;

View file

@ -80,8 +80,7 @@ in
enable = true; enable = true;
qemu = { qemu = {
#don't hook evdev at vm start #don't hook evdev at vm start
package = pkgs.qemu_kvm.overrideAttrs ( package = pkgs.qemu_kvm.overrideAttrs (old: {
old: {
patches = old.patches ++ [ patches = old.patches ++ [
(pkgs.writeText "qemu.diff" '' (pkgs.writeText "qemu.diff" ''
diff --git a/ui/input-linux.c b/ui/input-linux.c diff --git a/ui/input-linux.c b/ui/input-linux.c
@ -103,8 +102,7 @@ in
return; return;
'') '')
]; ];
} });
);
runAsRoot = true; runAsRoot = true;
ovmf.enable = true; ovmf.enable = true;
verbatimConfig = '' verbatimConfig = ''

View file

@ -37,8 +37,7 @@ rec {
mkModules = mkModules =
path: path:
lib.listToAttrs ( lib.listToAttrs (
map map (name: {
(name: {
name = lib.pipe name [ name = lib.pipe name [
toString toString
(lib.removeSuffix ".nix") (lib.removeSuffix ".nix")
@ -49,15 +48,13 @@ rec {
(builtins.replaceStrings (lib.singleton "#_file") (lib.singleton ''_file = "${name}";'')) (builtins.replaceStrings (lib.singleton "#_file") (lib.singleton ''_file = "${name}";''))
(builtins.toFile (builtins.baseNameOf path)) (builtins.toFile (builtins.baseNameOf path))
]; ];
}) }) (listNixFilesRecursive path)
(listNixFilesRecursive path)
); );
gerg-utils = gerg-utils =
config: outputs: config: outputs:
lib.foldAttrs lib.mergeAttrs { } ( lib.foldAttrs lib.mergeAttrs { } (
map map (
(
system: system:
let let
pkgs = pkgs =
@ -67,8 +64,7 @@ rec {
import unstable { inherit system config; }; import unstable { inherit system config; };
in in
lib.mapAttrs (name: value: if needsSystem name then { ${system} = value pkgs; } else value) outputs lib.mapAttrs (name: value: if needsSystem name then { ${system} = value pkgs; } else value) outputs
) ) [ "x86_64-linux" ]
[ "x86_64-linux" ]
); );
mkHosts = mkHosts =
@ -101,12 +97,10 @@ rec {
mkDisko = mkDisko =
names: names:
lib.listToAttrs ( lib.listToAttrs (
map map (name: {
(name: {
name = "disko-${name}"; name = "disko-${name}";
value.disko.devices = import "${self}/disko/${name}.nix" lib; value.disko.devices = import "${self}/disko/${name}.nix" lib;
}) }) names
names
); );
/* /<name> -> packages named by directory /* /<name> -> packages named by directory

View file

@ -1,5 +1,10 @@
inputs: inputs:
{ lib, config, ... }: {
lib,
config,
pkgs,
...
}:
{ {
# #
# Flake registry and $NIX_PATH pinning # Flake registry and $NIX_PATH pinning
@ -10,13 +15,10 @@ inputs:
(x: x // { nixpkgs.flake = inputs.unstable; }) (x: x // { nixpkgs.flake = inputs.unstable; })
]; ];
environment.etc = environment.etc = lib.mapAttrs' (name: value: {
lib.mapAttrs'
(name: value: {
name = "nix/path/${name}"; name = "nix/path/${name}";
value.source = value.flake; value.source = value.flake;
}) }) config.nix.registry;
config.nix.registry;
nix.nixPath = [ "/etc/nix/path" ]; nix.nixPath = [ "/etc/nix/path" ];
# #
# Ignore global registry # Ignore global registry
@ -25,7 +27,14 @@ inputs:
# #
# Use nix directly from master # Use nix directly from master
# #
nix.package = inputs.nix.packages.default; nix.package = inputs.nix.packages.default.overrideAttrs (old: {
patches = old.patches or [ ] ++ [
(pkgs.fetchpatch {
url = "https://github.com/NixOS/nix/commit/b6ae3be9c6ec4e9de55479188e76fc330b2304dd.patch";
hash = "sha256-VyIywGo1ie059wXmGWx+bNeHz9lNk6nlkJ/Qgd1kmzw=";
})
];
});
# #
# Other nix settings # Other nix settings
# #
@ -56,6 +65,10 @@ inputs:
allowed-users = [ "@wheel" ]; allowed-users = [ "@wheel" ];
use-xdg-base-directories = true; use-xdg-base-directories = true;
auto-allocate-uids = true; auto-allocate-uids = true;
#
# A option for the custom patch
#
reject-flake-config = true;
}; };
#_file #_file
} }

View file

@ -5,8 +5,7 @@
jre, jre,
makeBinaryWrapper, makeBinaryWrapper,
}: }:
stdenvNoCC.mkDerivation ( stdenvNoCC.mkDerivation (finalAttrs: {
finalAttrs: {
pname = "papermc"; pname = "papermc";
version = "1.20.1.83"; version = "1.20.1.83";
@ -50,5 +49,4 @@ stdenvNoCC.mkDerivation (
]; ];
mainProgram = "minecraft-server"; mainProgram = "minecraft-server";
}; };
} })
)