Add deemix + config

This commit is contained in:
Riley Apeldoorn 2023-09-02 23:26:09 +02:00
parent 2858ec8363
commit 4fd6205b88
10 changed files with 40 additions and 5 deletions

View file

@ -13,15 +13,15 @@
oxalica.url = github:oxalica/rust-overlay;
};
outputs = args@{ home-manager, nixpkgs, agenix, nixos-hardware, oxalica, ... }: with nixpkgs; {
outputs = args@{ home-manager, nixpkgs, agenix, nixos-hardware, oxalica, ... }: with nixpkgs; rec {
# Configurations for NixOS machines.
nixosConfigurations =
let mkUserConfig = path: {
let mkUserConfig = path: { config, ... }: {
imports = [ home-manager.nixosModules.home-manager ];
config = {
home-manager.users."riley" = (import "${path}/home.nix");
home-manager.extraSpecialArgs = args;
home-manager.extraSpecialArgs = args // { age = config.age; };
home-manager.useGlobalPkgs = true;
};
};
@ -66,7 +66,7 @@
# Configurations for non-NixOS machines.
homeConfigurations = with home-manager.lib; {
"dev-lt-63" = homeManagerConfiguration {
extraSpecialArgs = args;
extraSpecialArgs = args // { age = args.config.age; };
pkgs = import nixpkgs { system = "x86_64-linux"; };
modules = [
./system/dev-lt-63/home.nix

BIN
secret/arl.age Normal file

Binary file not shown.

Binary file not shown.

View file

@ -13,4 +13,6 @@ let strawberry = [
in {
# Secrets for backup cloud storage provider
"secret/backblaze.age".publicKeys = all;
# The ARL for my deezer account
"secret/arl.age".publicKeys = all;
}

View file

@ -9,6 +9,7 @@ in with lib; {
# TODO: Add strawberry as a build machine here
config = {
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [ (import ../overlay.nix) ];
nix.extraOptions = ''
experimental-features = nix-command flakes
'';

View file

@ -3,13 +3,14 @@
# needed to do extra configuration for example, consider putting
# the affected programs in their own modules.
{ pkgs, ... }: {
{ pkgs, age, ... }: {
home.packages = (with pkgs; [
eva
hyperfine
du-dust
pijul
python311Packages.deemix
]) ++ (import ../env.nix pkgs);
# CLI for accessing my passwords
@ -44,4 +45,6 @@
};
};
xdg.configFile."deemix/.arl".source = age.secrets."arl".path;
}

View file

@ -10,4 +10,7 @@ with (import ./lib.nix final); {
prev.tor-browser-bundle-bin.override {
useHardenedMalloc = false;
};
python311Packages.deemix = prev.python311Packages.deemix.overrideAttrs (old: {
patches = [./patch/dont_write_arl.patch];
});
}

View file

@ -0,0 +1,18 @@
diff --git a/deemix/__main__.py b/deemix/__main__.py
index 39a878a..74acf8d 100644
--- a/deemix/__main__.py
+++ b/deemix/__main__.py
@@ -47,9 +47,10 @@ def download(url, bitrate, portable, path):
with open(configFolder / '.arl', 'r', encoding="utf-8") as f:
arl = f.readline().rstrip("\n").strip()
if not dz.login_via_arl(arl): arl = requestValidArl()
- else: arl = requestValidArl()
- with open(configFolder / '.arl', 'w', encoding="utf-8") as f:
- f.write(arl)
+ else:
+ arl = requestValidArl()
+ with open(configFolder / '.arl', 'w', encoding="utf-8") as f:
+ f.write(arl)
plugins = {}
if Spotify:

View file

@ -1,5 +1,10 @@
{
age.secrets = {
"backblaze".file = ../secret/backblaze.age;
"arl" = {
file = ../secret/arl.age;
owner = "riley";
mode = "777"; # Fuck it we ball
};
};
}

View file

@ -26,5 +26,8 @@
home-manager.users."riley".home.stateVersion = "22.11";
programs.adb.enable = true;
users.users."riley".extraGroups = ["adbusers"];
}