From 20f6f6f51cac1a10f2f9884836fb6eb7b3c99624 Mon Sep 17 00:00:00 2001 From: sstent Date: Sat, 18 Feb 2023 15:19:04 -0500 Subject: [PATCH] x --- beets.nix | 9 ++---- flake.lock | 60 +++++++++++++++++++++++++++++++++++- flake.nix | 9 +++++- home.nix | 67 +++++++++++++++++++++++++++-------------- new_modules/mullvad.nix | 20 ++++++++++++ scripts/mullvad.sh | 16 ++++++++++ 6 files changed, 150 insertions(+), 31 deletions(-) create mode 100644 new_modules/mullvad.nix create mode 100644 scripts/mullvad.sh diff --git a/beets.nix b/beets.nix index e787fcf..3f87db2 100644 --- a/beets.nix +++ b/beets.nix @@ -5,8 +5,6 @@ programs.beets = { enable = true; settings = { - -{ album_fields = { artist_grouping = '' albumartist_dev = ["devin townsend", "devin townsend project","punky brĂ¼ster","strapping young lad"] @@ -115,7 +113,7 @@ 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"; + 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 = [ @@ -141,13 +139,12 @@ "artist The Knife in collaboration with Mount Sims and Planningtorock" = "The Knife"; "artist Unida _ Dozer" = "Unida"; }; -} +}; }; - }; -} + } diff --git a/flake.lock b/flake.lock index b63ea8d..7ca4d76 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,46 @@ { "nodes": { + "agenix": { + "inputs": { + "darwin": "darwin", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1676599101, + "narHash": "sha256-CKS6UsOGhoNxGDBt9wyFiWHvtng/+BMAJ4G8ahhe1DE=", + "owner": "ryantm", + "repo": "agenix", + "rev": "de657061b13cf329c57a1a9730a5049a971b40b3", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, + "darwin": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1673295039, + "narHash": "sha256-AsdYgE8/GPwcelGgrntlijMg4t3hLFJFCRF3tL5WVjA=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "87b9d090ad39b25b2400029c64825fc2a8868943", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -22,6 +63,22 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1674641431, + "narHash": "sha256-qfo19qVZBP4qn5M5gXc/h1MDgAtPA5VxJm9s8RUAkVk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9b97ad7b4330aacda9b2343396eb3df8a853b4fc", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1667231093, "narHash": "sha256-RERXruzBEBuf0c7OfZeX1hxEKB+PTCUNxWeB6C1jd8Y=", @@ -39,8 +96,9 @@ }, "root": { "inputs": { + "agenix": "agenix", "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" } }, "utils": { diff --git a/flake.nix b/flake.nix index 0a798b6..52ee834 100644 --- a/flake.nix +++ b/flake.nix @@ -8,9 +8,10 @@ url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; + agenix.url = "github:ryantm/agenix"; }; - outputs = { nixpkgs, home-manager, ... }: + outputs = { nixpkgs, home-manager, agenix,... }: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; @@ -24,6 +25,12 @@ # the path to your home.nix. modules = [ ./home.nix + # Add agenix for secret management. + # agenix.nixosModules.age + # { + # environment.systemPackages = [agenix.defaultPackage.${system}]; + # } + ]; # Optionally use extraSpecialArgs diff --git a/home.nix b/home.nix index b80abaf..e3ee70d 100644 --- a/home.nix +++ b/home.nix @@ -38,7 +38,11 @@ #git-run mr perl - beets + # beets + qemu_kvm + nixos-generators + nixfmt + deploy-rs ]; @@ -46,39 +50,56 @@ services.keybase.enable = true; services.kbfs.enable = true; home.file.".mrconfig".source = ./mrconfig; # xdg.configFile."beets/config.yaml".source = ./beets_config.yaml; +programs = { + dircolors.enable = true; + go.enable = true; + gpg.enable = true; + htop.enable = true; + jq.enable = true; + less.enable = true; + man.enable = true; + nix-index.enable = true; + yt-dlp.enable = true; + bash = { + enable = true; + bashrcExtra = '' + export DOCKER_HOST="tcp://192.168.1.223:2375"; + export NOMAD_ADDR="http://192.168.1.250:4646"; + export TERM="xterm-256color"; + export ANSIBLE_HOST_KEY_CHECKING=False + + export HSTR_CONFIG=hicolor # get more colors + shopt -s histappend # append new history items to .bash_history + export HISTCONTROL=ignorespace # leading space hides commands from history + # ensure synchronization between bash memory and history file + export PROMPT_COMMAND="history -a;" + + if [ -e /home/sstent/.nix-profile/etc/profile.d/nix.sh ]; then . /home/sstent/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer + + #keybase service & + # Configure ssh forwarding + . ~/bin/wsl-ssh-agent-forwarder + ssh-add -l -programs.bash = { - enable = true; - bashrcExtra = '' - export DOCKER_HOST="tcp://192.168.1.223:2375"; - export NOMAD_ADDR="http://192.168.1.250:4646"; - export TERM="xterm-256color"; - export ANSIBLE_HOST_KEY_CHECKING=False - if [ -e /home/sstent/.nix-profile/etc/profile.d/nix.sh ]; then . /home/sstent/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer - #keybase service & - # Configure ssh forwarding - . ~/bin/wsl-ssh-agent-forwarder - ssh-add -l - - ''; - -}; - - programs.git = { + ''; + }; + git = { enable = true; userName = "sstent"; userEmail = "stuart.stent@gmail.com"; }; - - programs.ssh.enable = true; - programs.ssh.matchBlocks = { + ssh = { + enable = true; + matchBlocks = { "odroid*" = { user = "root"; }; }; + }; +}; imports = [ ./beets.nix -] +]; } diff --git a/new_modules/mullvad.nix b/new_modules/mullvad.nix new file mode 100644 index 0000000..7717d89 --- /dev/null +++ b/new_modules/mullvad.nix @@ -0,0 +1,20 @@ +_: { config, lib, pkgs, ... }: + +{ + # Add options for mullvad, a vpn + options.mullvad.enable = lib.mkEnableOption "mullvad"; + + # Install mullvad if desired + config = lib.mkIf config.mullvad.enable { + + # Enable mullvad + services.mullvad-vpn.enable = true; + + # Install programs related to mullvad + environment.systemPackages = with pkgs; [ + + # Desktop client for mullvad + mullvad-vpn + ]; + }; +} diff --git a/scripts/mullvad.sh b/scripts/mullvad.sh new file mode 100644 index 0000000..eedc985 --- /dev/null +++ b/scripts/mullvad.sh @@ -0,0 +1,16 @@ +# install +nix-env -i mullvad-vpn +# start daemon +sudo mullvad-daemon --disable-log-to-file +# set account number +mullvad account set XXXXXXXXXXXXXXX +# list possible relays +mullvad relay list +# set switzerland secure and independent legislation +mullvad relay set location ch +# connect +mullvad connect +# check status +mullvad status +# set default connect +mullvad auto-connect set on \ No newline at end of file