refactor: fix nix formatting

This commit is contained in:
Felix Schröter 2022-01-01 02:13:02 +01:00
parent e02d84533d
commit 4e2f60294a
No known key found for this signature in database
GPG key ID: 910ACB9F6BD26F58
6 changed files with 45 additions and 62 deletions

View file

@ -1,24 +1,24 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; boot.initrd.availableKernelModules =
[ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ "dm-snapshot" ]; boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/155b5acf-a0f8-4615-ae03-43a5c193f772"; device = "/dev/disk/by-uuid/155b5acf-a0f8-4615-ae03-43a5c193f772";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/31C7-CBD1"; device = "/dev/disk/by-uuid/31C7-CBD1";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = swapDevices =
[ { device = "/dev/disk/by-uuid/397a1a92-596f-421b-99e1-c9b2cb821309"; } [{ device = "/dev/disk/by-uuid/397a1a92-596f-421b-99e1-c9b2cb821309"; }];
];
# TODO keep this disabled? # TODO keep this disabled?
# nix.maxJobs = lib.mkDefault 8; # nix.maxJobs = lib.mkDefault 8;

View file

@ -121,12 +121,12 @@ in {
cp -r ${scriptBin}/bin/${name} $out/bin/${name} cp -r ${scriptBin}/bin/${name} $out/bin/${name}
cp -r ${desktopFile}/share/applications $out/share/applications cp -r ${desktopFile}/share/applications $out/share/applications
''; '';
in (with pkgs; in with pkgs; [
[ (tor-browser-bundle-bin.override { pulseaudioSupport = true; }) ]) ++ [ (tor-browser-bundle-bin.override { pulseaudioSupport = true; })
(makeFirefoxProfileBin { (makeFirefoxProfileBin {
profile = "work"; profile = "work";
desktopName = "Firefox (Work)"; desktopName = "Firefox (Work)";
icon = "firefox"; icon = "firefox";
}) })
]; ];
} }

View file

@ -1,9 +1,5 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
imports = [ imports = [ ./gtk.nix ./gnome.nix ./mimeapps.nix ];
./gtk.nix
./gnome.nix
./mimeapps.nix
];
} }

View file

@ -1,53 +1,39 @@
{ lib, pkgs, config, ... }: { lib, pkgs, config, ... }:
with lib; with lib;
let let cfg = config.programs.git;
cfg = config.programs.git; in {
in
{
options.programs.git = { options.programs.git = {
profiles = mkOption { profiles = mkOption {
type = types.attrsOf (types.submodule ({ name, config, ... }: { type = types.attrsOf (types.submodule ({ name, config, ... }: {
options = { options = {
name = mkOption { name = mkOption { type = types.str; };
type = types.str; email = mkOption { type = types.str; };
}; signingKey = mkOption { type = types.str; };
email = mkOption { dirs = mkOption { type = types.listOf types.str; };
type = types.str;
};
signingKey = mkOption {
type = types.str;
};
dirs = mkOption {
type = types.listOf types.str;
};
}; };
})); }));
}; };
defaultProfile = mkOption { defaultProfile = mkOption { type = types.str; };
type = types.str;
};
}; };
config = let config = let profiles = cfg.profiles;
profiles = cfg.profiles;
in { in {
programs.git = { programs.git = {
userName = profiles."${cfg.defaultProfile}".name; userName = profiles."${cfg.defaultProfile}".name;
userEmail = profiles."${cfg.defaultProfile}".email; userEmail = profiles."${cfg.defaultProfile}".email;
signing = { signing = { key = profiles."${cfg.defaultProfile}".signingKey; };
key = profiles."${cfg.defaultProfile}".signingKey; includes = flatten (mapAttrsToList (name: profile:
}; map (dir: {
includes = flatten (mapAttrsToList (name: profile: map (dir: { condition = "gitdir:${dir}";
condition = "gitdir:${dir}"; contents = {
contents = { user = {
user = { name = profile.name;
name = profile.name; email = profile.email;
email = profile.email; signingKey = profile.signingKey;
signingKey = profile.signingKey; };
}; };
}; }) profile.dirs) profiles);
}) profile.dirs) profiles);
}; };
}; };
} }

View file

@ -6,7 +6,8 @@ mkDerivation rec {
version = "2.09.03"; version = "2.09.03";
src = fetchurl { src = fetchurl {
url = "https://deconz.dresden-elektronik.de/debian/stable/deconz_${version}-debian-stretch-stable_arm64.deb"; url =
"https://deconz.dresden-elektronik.de/debian/stable/deconz_${version}-debian-stretch-stable_arm64.deb";
sha256 = "6EXYoXOg+6dTR9/hRHmNafZuBeNnAAS4z8ia15s1+9U="; sha256 = "6EXYoXOg+6dTR9/hRHmNafZuBeNnAAS4z8ia15s1+9U=";
}; };

View file

@ -20,7 +20,9 @@ in {
}; };
# easypi/ot-recorder-arm uses different store location # easypi/ot-recorder-arm uses different store location
# volumes = [ "/var/lib/owntracks/recorder/store:/store" ]; # volumes = [ "/var/lib/owntracks/recorder/store:/store" ];
volumes = [ "/var/lib/owntracks/recorder/store:/var/spool/owntracks/recorder/store" ]; volumes = [
"/var/lib/owntracks/recorder/store:/var/spool/owntracks/recorder/store"
];
extraOptions = [ extraOptions = [
# TODO systemd doesn't substitute variables because it doesn't run in a shell # TODO systemd doesn't substitute variables because it doesn't run in a shell
# "-e OTR_PASS=\"$(cat /etc/nixos/secrets/mqtt/owntracks-plain)\"" # "-e OTR_PASS=\"$(cat /etc/nixos/secrets/mqtt/owntracks-plain)\""
@ -36,9 +38,7 @@ in {
SERVER_PORT = "8083"; SERVER_PORT = "8083";
LISTEN_PORT = "8085"; LISTEN_PORT = "8085";
}; };
volumes = [ volumes = [ "${frontend-config}:/usr/share/nginx/html/config/config.js" ];
"${frontend-config}:/usr/share/nginx/html/config/config.js"
];
extraOptions = [ "--network=host" ]; extraOptions = [ "--network=host" ];
}; };
}; };