This commit is contained in:
2024-01-24 22:36:34 +00:00
parent d2150a7470
commit 8c279674b0
12 changed files with 264 additions and 260 deletions

View File

@@ -72,8 +72,9 @@
config.allowUnfree = true; # forgive me Stallman senpai config.allowUnfree = true; # forgive me Stallman senpai
overlays = extraOverlays ++ (lib.attrValues self.overlays); overlays = extraOverlays ++ (lib.attrValues self.overlays);
}; };
pkgs = mkPkgs nixpkgs [self.overlay]; # pkgs = mkPkgs nixpkgs [self.overlay];
pkgs' = mkPkgs nixpkgs-unstable []; pkgs = mkPkgs nixpkgs [];
# pkgs' = mkPkgs nixpkgs-unstable [];
lib = lib =
nixpkgs.lib.extend nixpkgs.lib.extend
@@ -87,18 +88,17 @@
// home-manager.lib); // home-manager.lib);
in { in {
lib = lib.my; lib = lib.my;
packages."${system}" = packages."${system}" = mapModules ./pkgs (p: pkgs.callPackage p {});
mapModules ./pkgs (p: pkgs.callPackage p {});
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra; formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
devShell."${system}" = devShell."${system}" =
import ./shell.nix {inherit pkgs;}; import ./shell.nix {inherit pkgs;};
overlay = final: prev: { # overlay = final: prev: {
unstable = pkgs'; # unstable = pkgs';
my = self.packages."${system}"; # my = self.packages."${system}";
keybase = pkgs'.keybase; # keybase = pkgs'.keybase;
}; # };
overlays = import ./overlays {inherit inputs;}; overlays = import ./overlays {inherit inputs;};

View File

@@ -32,10 +32,8 @@
home.file."/home/sstent/justfile".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/vmimages/dotfiles/${config.home.username}/justfile"; home.file."/home/sstent/justfile".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/vmimages/dotfiles/${config.home.username}/justfile";
home.file."/home/sstent/.config/bash-completions/nomad_.bash".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/vmimages/dotfiles/${config.home.username}/nomad_.bash"; home.file."/home/sstent/.config/bash-completions/nomad_.bash".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/vmimages/dotfiles/${config.home.username}/nomad_.bash";
# home.file."/home/sstent/.config/beets/test".source = config.lib.file.mkOutOfStoreSymlink /run/user/1000/secrets/test; # home.file."/home/sstent/.config/beets/test".source = config.lib.file.mkOutOfStoreSymlink /run/user/1000/secrets/test;
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
programs.home-manager.enable = true; programs.home-manager.enable = true;
home.packages = with pkgs; [ home.packages = with pkgs; [
@@ -65,7 +63,8 @@
# deploy-rs # deploy-rs
gnumake gnumake
unstable.keybase unstable.keybase
]; # my.prometheus-api-client
];
custom = { custom = {
ssh-proxy.enable = false; ssh-proxy.enable = false;
@@ -124,9 +123,9 @@
ssh = { ssh = {
enable = true; enable = true;
extraConfig = '' extraConfig = ''
StrictHostKeyChecking no StrictHostKeyChecking no
UpdateHostKeys yes UpdateHostKeys yes
identityFile = "~/.ssh/id_rsa" identityFile = "~/.ssh/id_rsa"
''; '';
matchBlocks = { matchBlocks = {
# "*" = { # "*" = {

View File

@@ -5,5 +5,4 @@ pkgs.python3.withPackages (p:
setuptools # setup.py setuptools # setup.py
paramiko # ssh library paramiko # ssh library
prometheus-api-client prometheus-api-client
]) ])

View File

@@ -1,15 +1,22 @@
{
{ lib, inputs, outputs, pkgs, config, ... }: lib,
inputs,
outputs,
pkgs,
config,
...
}:
# Define qemu-arm-static source. # Define qemu-arm-static source.
let qemu-arm-static = pkgs.stdenv.mkDerivation { let
name = "qemu-arm-static"; qemu-arm-static = pkgs.stdenv.mkDerivation {
src = builtins.fetchurl { name = "qemu-arm-static";
url = "https://github.com/multiarch/qemu-user-static/releases/download/v6.1.0-8/qemu-arm-static"; src = builtins.fetchurl {
sha256 = "06344d77d4f08b3e1b26ff440cb115179c63ca8047afb978602d7922a51231e3"; url = "https://github.com/multiarch/qemu-user-static/releases/download/v6.1.0-8/qemu-arm-static";
sha256 = "06344d77d4f08b3e1b26ff440cb115179c63ca8047afb978602d7922a51231e3";
};
dontUnpack = true;
installPhase = "install -D -m 0755 $src $out/bin/qemu-arm-static";
}; };
dontUnpack = true;
installPhase = "install -D -m 0755 $src $out/bin/qemu-arm-static";
};
in { in {
# Enable binfmt emulation of extra binary formats (armv7l-linux, for exmaple). # Enable binfmt emulation of extra binary formats (armv7l-linux, for exmaple).
boot.binfmt.registrations.arm = { boot.binfmt.registrations.arm = {
@@ -22,5 +29,5 @@ in {
nix.extraOptions = '' nix.extraOptions = ''
extra-platforms = armv7l-linux aarch64-linux extra-platforms = armv7l-linux aarch64-linux
''; '';
nix.settings.extra-sandbox-paths = [ "/run/binfmt/arm=${qemu-arm-static}/bin/qemu-arm-static" ]; nix.settings.extra-sandbox-paths = ["/run/binfmt/arm=${qemu-arm-static}/bin/qemu-arm-static"];
} }

View File

@@ -54,7 +54,7 @@
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
programs.fuse.userAllowOther = true; programs.fuse.userAllowOther = true;
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;
virtualisation.docker.enable = true; virtualisation.docker.enable = true;
# nixpkgs.overlays = overlays; # nixpkgs.overlays = overlays;
# Enable nix flakes # Enable nix flakes
@@ -66,21 +66,21 @@
# nix.nixPath = [ "nixpkgs=pkgs.outPath" ]; # nix.nixPath = [ "nixpkgs=pkgs.outPath" ];
networking.search = ["node.dc1.consul" "service.dc1.consul"]; networking.search = ["node.dc1.consul" "service.dc1.consul"];
networking.nameservers = ["192.168.1.1" "1.1.1.1"]; networking.nameservers = ["192.168.1.1" "1.1.1.1"];
# Enable networking # Enable networking
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
# Select internationalisation properties. # Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = { i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8"; LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8"; LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8"; LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8"; LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8"; LC_NAME = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8"; LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8"; LC_TELEPHONE = "en_US.UTF-8";
}; };
#services.envfs.enable = true; #services.envfs.enable = true;
environment.systemPackages = [ environment.systemPackages = [

View File

@@ -18,7 +18,6 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = [ home.packages = [
pkgs.ffmpeg # for replaygain pkgs.ffmpeg # for replaygain
]; ];
sops = { sops = {
@@ -29,7 +28,14 @@ in {
programs.beets = { programs.beets = {
enable = true; enable = true;
package = (pkgs.beets.override { pluginOverrides = { originquery = {enable = true; propagatedBuildInputs = [ pkgs.beets-originquery ]; }; };}); package = pkgs.beets.override {
pluginOverrides = {
originquery = {
enable = true;
propagatedBuildInputs = [pkgs.beets-originquery];
};
};
};
settings = { settings = {
album_fields = { album_fields = {
artist_grouping = '' artist_grouping = ''
@@ -131,25 +137,24 @@ in {
format_item = "$albumartist - $album [$albumtype]$atype: $track/$tracktotal $title"; format_item = "$albumartist - $album [$albumtype]$atype: $track/$tracktotal $title";
}; };
musicbrainz = { musicbrainz = {
extra_tags= ["year" "catalognum" "country" "media" "label"]; extra_tags = ["year" "catalognum" "country" "media" "label"];
pass = "7ANCLPczDNFn6Sf65vdZ"; pass = "7ANCLPczDNFn6Sf65vdZ";
user = "shapechecker"; user = "shapechecker";
}; };
original_date = true; original_date = true;
originquery = { originquery = {
origin_file = "origin.yaml"; origin_file = "origin.yaml";
tag_patterns = { tag_patterns = {
media = ''$.Media''; media = ''$.Media'';
year = ''$."Edition year"''; year = ''$."Edition year"'';
label = ''$."Record label"''; label = ''$."Record label"'';
catalognum = ''$."Catalog number"''; catalognum = ''$."Catalog number"'';
albumdisambig = ''$.Edition''; albumdisambig = ''$.Edition'';
}; };
use_origin_on_conflict = true;
};
use_origin_on_conflict = true;
};
paths = { paths = {
"albumtype:soundtrack" = "Soundtracks/$albumartist - $album%aunique{} ($year)/$myDisc$track - $artist - $title"; "albumtype:soundtrack" = "Soundtracks/$albumartist - $album%aunique{} ($year)/$myDisc$track - $artist - $title";

View File

@@ -18,17 +18,17 @@ in {
wsl.extraBin = [ wsl.extraBin = [
# Required by VS Code's Remote WSL extension # Required by VS Code's Remote WSL extension
# Required by VS Code's Remote WSL extension # Required by VS Code's Remote WSL extension
{ src = "${pkgs.coreutils}/bin/dirname"; } {src = "${pkgs.coreutils}/bin/dirname";}
{ src = "${pkgs.coreutils}/bin/readlink"; } {src = "${pkgs.coreutils}/bin/readlink";}
{ src = "${pkgs.coreutils}/bin/uname"; } {src = "${pkgs.coreutils}/bin/uname";}
{ src = "${pkgs.coreutils}/bin/mkdir"; } {src = "${pkgs.coreutils}/bin/mkdir";}
{ src = "${pkgs.coreutils}/bin/rm"; } {src = "${pkgs.coreutils}/bin/rm";}
{ src = "${pkgs.coreutils}/bin/wc"; } {src = "${pkgs.coreutils}/bin/wc";}
{ src = "${pkgs.coreutils}/bin/date"; } {src = "${pkgs.coreutils}/bin/date";}
{ src = "${pkgs.coreutils}/bin/mv"; } {src = "${pkgs.coreutils}/bin/mv";}
{ src = "${pkgs.coreutils}/bin/sleep"; } {src = "${pkgs.coreutils}/bin/sleep";}
{ src = "${pkgs.gnutar}/bin/tar"; } {src = "${pkgs.gnutar}/bin/tar";}
{ src = "${pkgs.gzip}/bin/gzip"; } {src = "${pkgs.gzip}/bin/gzip";}
]; ];
programs.nix-ld = { programs.nix-ld = {
enable = true; enable = true;

View File

@@ -1,31 +1,28 @@
# This file defines overlays # This file defines overlays
# ex
{inputs, ...}: { {inputs, ...}: {
# This one brings our custom packages from the 'pkgs' directory # This one brings our custom packages from the 'pkgs' directory
## this overrides the 'my.' strcuture
additions = final: _prev: import ../pkgs {pkgs = final;}; additions = final: _prev: import ../pkgs {pkgs = final;};
# This one contains whatever you want to overlay # This one contains whatever you want to overlay
# You can change versions, add patches, set compilation flags, anything really. # You can change versions, add patches, set compilation flags, anything really.
# https://nixos.wiki/wiki/Overlays # https://nixos.wiki/wiki/Overlays
modifications = final: prev: { modifications = final: prev: {
# example = prev.example.overrideAttrs (oldAttrs: rec { pythonPackagesExtensions =
# ... prev.pythonPackagesExtensions
# }); ++ [
(
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [ python-final: python-prev: {
( prometheus-api-client = python-final.callPackage ../pkgs/prometheus-api-client {};
python-final: python-prev: }
{ )
prometheus-api-client = python-final.callPackage ../pkgs/python/prometheus-api-client { }; ];
} keybase = final.unstable.keybase;
)
];
}; };
# When applied, the unstable nixpkgs set (declared in the flake inputs) will #When applied, the unstable nixpkgs set (declared in the flake inputs) will
# be accessible through 'pkgs.unstable' #be accessible through 'pkgs.unstable'
unstable-packages = final: _prev: { unstable-packages = final: _prev: {
unstable = import inputs.nixpkgs-unstable { unstable = import inputs.nixpkgs-unstable {
system = final.system; system = final.system;

View File

@@ -1,35 +1,35 @@
{ python3Packages {
, fetchFromGitHub python3Packages,
, beets fetchFromGitHub,
, lib beets,
lib,
}: }:
with python3Packages; with python3Packages;
buildPythonPackage rec { buildPythonPackage rec {
pname = "beets-originquery"; pname = "beets-originquery";
version = "unstable-2022-03-11"; version = "unstable-2022-03-11";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "x1ppy"; owner = "x1ppy";
repo = "beets-originquery"; repo = "beets-originquery";
rev = "c353e2b68804cb4dabca0f0f177cee1137888ca4"; rev = "c353e2b68804cb4dabca0f0f177cee1137888ca4";
hash = "sha256-vNROKZgCoWtoou9B8hpJwl4Yf6TzQU0TbKJUd94v7vk="; hash = "sha256-vNROKZgCoWtoou9B8hpJwl4Yf6TzQU0TbKJUd94v7vk=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
beets beets
setuptools-scm setuptools-scm
]; ];
propagatedBuildInputs = [ jsonpath_rw ]; propagatedBuildInputs = [jsonpath_rw];
# There's no test # There's no test
doCheck = false; doCheck = false;
pythonImportsCheck = [ "beetsplug.originquery" ]; pythonImportsCheck = ["beetsplug.originquery"];
meta = { meta = {
description = "Plugin for beets that improves album matching"; description = "Plugin for beets that improves album matching";
homepage = "https://github.com/x1ppy/beets-originquery"; homepage = "https://github.com/x1ppy/beets-originquery";
}; };
} }

View File

@@ -4,4 +4,5 @@
# example = pkgs.callPackage ./example { }; # example = pkgs.callPackage ./example { };
npiperelay = pkgs.callPackage ./npiperelay {}; npiperelay = pkgs.callPackage ./npiperelay {};
beets-originquery = pkgs.callPackage ./beets-originquery {}; beets-originquery = pkgs.callPackage ./beets-originquery {};
prometheus-api-client = pkgs.callPackage ./prometheus-api-client {};
} }

View File

@@ -0,0 +1,31 @@
{
python3Packages,
fetchurl,
lib,
}:
with python3Packages;
buildPythonPackage rec {
pname = "prometheus-api-client";
version = "0.5.4";
src = fetchurl {
url = "https://pypi.org/packages/source/p/prometheus-api-client/prometheus-api-client-0.5.4.tar.gz";
sha256 = "sha256-OFaBB+GCqibyJZn3lCFeo93l7NPvFJRO72FO6qRsm2o=";
};
doCheck = false;
pythonImportsCheck = ["prometheus_api_client"];
propagatedBuildInputs = [
matplotlib
numpy
pandas
requests
dateparser
httmock
];
meta = with lib; {
description = "A python wrapper for the prometheus http api";
homepage = "https://github.com/4n4nd/prometheus-api-client-python";
licence = licences.mit;
};
}

View File

@@ -1,35 +0,0 @@
{ lib, python3, pkgs, callPackage, fetchurl,python3Packages, ... }:
let
pname = "prometheus-api-client";
version = "0.5.4";
src = fetchurl {
url = "https://pypi.org/packages/source/p/prometheus-api-client/prometheus-api-client-0.5.4.tar.gz";
sha256 = "sha256-OFaBB+GCqibyJZn3lCFeo93l7NPvFJRO72FO6qRsm2o=";
};
in
python3.pkgs.buildPythonPackage {
pname = pname;
version = version;
src = src;
doCheck = false;
propagatedBuildInputs = with pkgs.python3Packages; [
matplotlib
numpy
pandas
requests
dateparser
httmock
];
meta = with lib; {
description = "A python wrapper for the prometheus http api";
homepage = "https://github.com/4n4nd/prometheus-api-client-python";
licence = licences.mit;
};
}