refactor: fix nix formatting
This commit is contained in:
parent
e02d84533d
commit
4e2f60294a
6 changed files with 45 additions and 62 deletions
home
|
@ -121,12 +121,12 @@ in {
|
|||
cp -r ${scriptBin}/bin/${name} $out/bin/${name}
|
||||
cp -r ${desktopFile}/share/applications $out/share/applications
|
||||
'';
|
||||
in (with pkgs;
|
||||
[ (tor-browser-bundle-bin.override { pulseaudioSupport = true; }) ]) ++ [
|
||||
(makeFirefoxProfileBin {
|
||||
profile = "work";
|
||||
desktopName = "Firefox (Work)";
|
||||
icon = "firefox";
|
||||
})
|
||||
];
|
||||
in with pkgs; [
|
||||
(tor-browser-bundle-bin.override { pulseaudioSupport = true; })
|
||||
(makeFirefoxProfileBin {
|
||||
profile = "work";
|
||||
desktopName = "Firefox (Work)";
|
||||
icon = "firefox";
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./gtk.nix
|
||||
./gnome.nix
|
||||
./mimeapps.nix
|
||||
];
|
||||
imports = [ ./gtk.nix ./gnome.nix ./mimeapps.nix ];
|
||||
}
|
||||
|
|
|
@ -1,53 +1,39 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.git;
|
||||
in
|
||||
{
|
||||
let cfg = config.programs.git;
|
||||
in {
|
||||
options.programs.git = {
|
||||
profiles = mkOption {
|
||||
type = types.attrsOf (types.submodule ({ name, config, ... }: {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
email = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
signingKey = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
dirs = mkOption {
|
||||
type = types.listOf types.str;
|
||||
};
|
||||
name = mkOption { type = types.str; };
|
||||
email = mkOption { type = types.str; };
|
||||
signingKey = mkOption { type = types.str; };
|
||||
dirs = mkOption { type = types.listOf types.str; };
|
||||
};
|
||||
}));
|
||||
};
|
||||
defaultProfile = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
defaultProfile = mkOption { type = types.str; };
|
||||
};
|
||||
|
||||
config = let
|
||||
profiles = cfg.profiles;
|
||||
config = let profiles = cfg.profiles;
|
||||
in {
|
||||
programs.git = {
|
||||
userName = profiles."${cfg.defaultProfile}".name;
|
||||
userEmail = profiles."${cfg.defaultProfile}".email;
|
||||
signing = {
|
||||
key = profiles."${cfg.defaultProfile}".signingKey;
|
||||
};
|
||||
includes = flatten (mapAttrsToList (name: profile: map (dir: {
|
||||
condition = "gitdir:${dir}";
|
||||
contents = {
|
||||
user = {
|
||||
name = profile.name;
|
||||
email = profile.email;
|
||||
signingKey = profile.signingKey;
|
||||
signing = { key = profiles."${cfg.defaultProfile}".signingKey; };
|
||||
includes = flatten (mapAttrsToList (name: profile:
|
||||
map (dir: {
|
||||
condition = "gitdir:${dir}";
|
||||
contents = {
|
||||
user = {
|
||||
name = profile.name;
|
||||
email = profile.email;
|
||||
signingKey = profile.signingKey;
|
||||
};
|
||||
};
|
||||
};
|
||||
}) profile.dirs) profiles);
|
||||
}) profile.dirs) profiles);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue