new flake

This commit is contained in:
2023-12-01 22:42:33 +00:00
parent 5d7b023166
commit 8c0f9076d8
25 changed files with 593 additions and 1254 deletions

View File

@@ -11,48 +11,29 @@
# ./beets.nix
# ./keybase.nix
"${inputs.vscode-server}/modules/vscode-server/home.nix"
]
++ (builtins.attrValues outputs.homeManagerModules);
outputs.homeManagerModules
];
# ++ (builtins.attrValues outputs.homeManagerModules);
###dotfiles path variable
options._dotfiles = lib.mkOption {
type = lib.types.str;
default = "${inputs.self}/home-manager/dotfiles";
description = "Path to the dotfiles in this repository";
};
# config = {
# nixpkgs = {
# overlays = builtins.attrValues outputs.overlays;
# config = {
# allowUnfree = true;
# allowUnfreePredicate = _: true;
# };
# };
###secrets path variable
options._secrets = lib.mkOption {
type = lib.types.str;
default = "/run/user/1000/secrets/";
description = "Path to the Secrets runtime";
};
# nix = {
# package = lib.mkDefault pkgs.nix;
# settings = {
# experimental-features = ["nix-command" "flakes" "repl-flake"];
# warn-dirty = false;
# };
# };
###secretstore path variable
options._secretstore = lib.mkOption {
type = lib.types.str;
default = "${inputs.self}/secrets/";
description = "Path to the Secrets storage";
};
config = {
nixpkgs = {
overlays = builtins.attrValues outputs.overlays;
config = {
allowUnfree = true;
allowUnfreePredicate = _: true;
};
};
nix = {
package = lib.mkDefault pkgs.nix;
settings = {
experimental-features = ["nix-command" "flakes" "repl-flake"];
warn-dirty = false;
};
};
##VSCode
# ##VSCode
services.vscode-server.enable = true;
services.vscode-server.enableFHS = true;
services.vscode-server.nodejsPackage = pkgs.nodejs-18_x;

View File

@@ -0,0 +1,30 @@
{lib, ...}: let
inherit
(builtins)
readDir
;
inherit
(lib)
filterAttrs
hasPrefix
hasSuffix
mapAttrs'
nameValuePair
;
in rec {
filter = name: func: attrs: filterAttrs name (mapAttrs' func attrs);
# 'sops' Encrypted Secrets
hm_secrets = dir: out_dir:
filter (name: type: type != null && !(hasPrefix "_" name)) (name: type:
# if type == "regular" && hasSuffix ".age" name
if type == "regular"
then
nameValuePair name {
sopsFile = dir + "/${name}";
format = "binary";
path = out_dir + "/${name}";
}
else nameValuePair "" null) (readDir dir);
}

View File

@@ -0,0 +1,161 @@
{
inputs,
lib,
pkgs,
config,
outputs,
...
}: {
home.packages = [
pkgs.ffmpeg # for replaygain
];
sops = {
secrets.discogs_json = {
path = "${config.xdg.configHome}/beets/discogs_token.json";
};
};
programs.beets = {
enable = true;
settings = {
album_fields = {
artist_grouping = ''
albumartist_dev = ["devin townsend", "devin townsend project","punky brüster","strapping young lad"]
DevinFolder = "_Devin Townsend Projects"
if albumartist.lower() in albumartist_dev:
return DevinFolder
albumartist_les = ["primus", "les claypool","les claypool and the holy mackerel","les claypools duo de twang","oysterhead","colonel claypools bucket of bernie brains","the les claypool frog brigade","the claypool lennon delirium"]
LesFolder = "_Les Claypool Projects"
if albumartist.lower() in albumartist_les:
return LesFolder
'';
atype = ''
atypes = ['EP', 'Single','Live']
for atype in atypes:
if atype.lower() == albumtype.lower():
return f' [{atype}]'
'';
first_artist = "albumartist.split(', ',1)[0:1][0]";
};
albumtypes = {
bracket = "[]";
ignore_va = "compilation";
types = [
{ep = "EP";}
{single = "Single";}
{soundtrack = "OST";}
{live = "Live";}
{compilation = "Anthology";}
{remix = "Remix";}
];
};
aunique = {
bracket = "[]";
disambiguators = "media";
keys = "albumartist album";
};
copyartifacts = {extensions = ".cue .log .jpg .jpeg .png .txt";};
directory = "/mnt/q/CleanMusic/";
embedart = {auto = true;};
extrafiles = {
paths = {
artworkdir = "$albumpath/Artwork";
"ext:cue" = "$albumpath/$disc_folder/Data/";
"ext:jpg" = "$albumpath/$disc_folder/";
"ext:log" = "$albumpath/$disc_folder/Data/";
};
patterns = {
all = "*.*";
artworkdir = ["[sS]cans/" "[aA]rtwork/" "[aA]rt/" "[cC]over/"];
};
};
fetchart = {
auto = true;
sources = "filesystem coverart itunes amazon albumart fanarttv";
};
import = {
autotag = true;
bell = false;
copy = true;
languages = "en";
log = "~/.config/beets/beet.log";
move = false;
write = true;
};
item_fields = {
isMultidisc = "1 if disctotal > 1 else 0";
myBitDepth = "('' if bitdepth != 24 else '[24bit - '+ media + ']')";
myDisc = "('' if disctotal <= 1 else str(disc) + ' - ')";
mySongartist = "artist + ' - ' if artist != albumartist and artist != '' else ''";
};
library = "~/musiclibrary.db";
match = {
max_rec = {
album = "strong";
album_id = "strong";
albumdisambig = "strong";
artist = "strong";
catalognum = "strong";
country = "strong";
label = "strong";
media = "strong";
mediums = "strong";
missing_tracks = "medium";
source = "strong";
track_artist = "strong";
track_id = "strong";
track_index = "strong";
track_length = "strong";
track_title = "strong";
tracks = "strong";
unmatched_tracks = "medium";
year = "strong";
};
strong_rec_thresh = 5.0e-2;
};
missing = {
format_album = "$albumartist: ($year) $album $albumtype $atype";
format_item = "$albumartist - $album [$albumtype]$atype: $track/$tracktotal $title";
};
musicbrainz = {
pass = "7ANCLPczDNFn6Sf65vdZ";
user = "shapechecker";
};
original_date = true;
paths = {
"albumtype:soundtrack" = "Soundtracks/$albumartist - $album%aunique{} ($year)/$myDisc$track - $artist - $title";
comp = "Compilations/$albumartist/($year) $album%aunique{}/$myDisc$track - $artist - $title";
default = "%if{$artist_grouping,$artist_grouping/}$first_artist/$year - $album $atype%aunique{media}[%upper{$format}$bitdepth]%if{$media,[$media]}/%if{$isMultidisc,$disc - }$track - $mySongartist$title";
};
per_disc_numbering = true;
plugins = [
"albumtypes"
"duplicates"
"fetchart"
"rewrite"
"missing"
"chroma"
"embedart"
"inline"
"discogs"
"mbcollection"
"replaygain"
"info"
];
replaygain = {
backend = "ffmpeg";
};
rewrite = {
"artist Björk & Tríó Guðmundar Ingólfssonar" = "Björk";
"artist Brant Bjork and The Low Desert Punk Band" = "Brant Bjork";
"artist King Gizzard & The Lizard Wizard with Mild High Club" = "King Gizzard & The Lizard Wizard";
"artist Kyuss _ Queens of the Stone Age" = "Kyuss";
"artist Professor Elemental & Tom Caruana" = "Professor Elemental";
"artist Resin Dogs Feat Spikey Tee" = "Resin Dogs";
"artist Sepultura _ Exodus" = "Sepultura";
"artist The Knife in collaboration with Mount Sims and Planningtorock" = "The Knife";
"artist Unida _ Dozer" = "Unida";
};
};
};
}

View File

@@ -8,7 +8,10 @@
...
}: {
imports = [
../../global.nix
# # ../../global.nix
# # outputs.homeManagerModules
./beets.nix
];
home.username = "sstent";
home.homeDirectory = "/home/sstent";
@@ -16,10 +19,10 @@
sops = {
age.sshKeyPaths = ["/home/sstent/.ssh/id_ed25519"];
defaultSopsFile = "${config._secretstore}/user-secrets.yaml";
defaultSopsFile = ../../../secrets/user-secrets.yaml;
secrets = {
mrconfig = {
sopsFile = "${config._secretstore}/user_dotfiles/mrconfig";
sopsFile = ../../../secrets/user_dotfiles/mrconfig;
format = "binary";
path = "${config.home.homeDirectory}/.mrconfig";
};
@@ -58,11 +61,11 @@
gnumake
];
custom = {
ssh-proxy.enable = false;
beets.enable = true;
keybase.enable = true;
};
# custom = {
# # ssh-proxy.enable = false;
# beets.enable = true;
# # keybase.enable = true;
# };
# home.file.".mrconfig".source = config.lib.file.mkOutOfStoreSymlink "${config._secrets}/mrconfig";
programs = {
@@ -104,9 +107,9 @@
ssh = {
enable = true;
extraConfig = ''
StrictHostKeyChecking no
UpdateHostKeys yes
identityFile = "~/.ssh/id_rsa"
StrictHostKeyChecking no
UpdateHostKeys yes
identityFile = "~/.ssh/id_rsa"
'';
matchBlocks = {
# "*" = {