From 905b5680b176629e2280fd32eaccc45eaab126f6 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 2 Feb 2022 12:25:03 +0800 Subject: [PATCH] Clean up the files --- flake.nix | 24 +++--- hosts/ni/default.nix | 6 +- modules/home-manager/profiles/desktop.nix | 1 + modules/home-manager/profiles/dev.nix | 10 +++ modules/home-manager/profiles/editors.nix | 4 +- modules/home-manager/services/bleachbit.nix | 3 +- users/home-manager/foo-dogsquared/default.nix | 78 ++++++++++++++++++- 7 files changed, 109 insertions(+), 17 deletions(-) diff --git a/flake.nix b/flake.nix index 70e261a6..cb6a4023 100644 --- a/flake.nix +++ b/flake.nix @@ -63,7 +63,7 @@ forAllSystems = f: nixpkgs.lib.genAttrs inputs.flake-utils.lib.defaultSystems - (system: f system); + (system: f system); libExtended = nixpkgs.lib.extend (final: prev: (import ./lib { lib = final; }) // { @@ -75,6 +75,9 @@ # The default configuration for our NixOS systems. hostDefaultConfig = { + # Default architecture. + system = "x86_64-linux"; + # I want to capture the usual flakes to its exact version so we're # making them available to our system. This will also prevent the # annoying downloads since it always get the latest revision. @@ -91,12 +94,12 @@ }; # Set several binary caches. - nix = { - binaryCaches = [ + nix.settings = { + substituters = [ "https://nix-community.cachix.org" "https://foo-dogsquared.cachix.org" ]; - binaryCachePublicKeys = [ + trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "foo-dogsquared.cachix.org-1:/2fmqn/gLGvCs5EDeQmqwtus02TUmGy0ZlAEXqRE70E=" ]; @@ -107,10 +110,8 @@ # Extend nixpkgs with our overlays except for the NixOS-focused modules # here. - nixpkgs.overlays = overlays ++ [ - inputs.nix-alien.overlay - inputs.guix-overlay.overlay - ]; + nixpkgs.overlays = overlays + ++ [ inputs.nix-alien.overlay inputs.guix-overlay.overlay ]; # Please clean your temporary crap. boot.cleanTmpDir = true; @@ -151,8 +152,7 @@ }; }]; }; - in - { + in { # Exposes only my library with the custom functions to make it easier to # include in other flakes. lib = import ./lib { lib = nixpkgs.lib; }; @@ -181,7 +181,9 @@ # My custom packages, available in here as well. Though, I mainly support # "x86_64-linux". I just want to try out supporting other systems. packages = forAllSystems (system: - import ./pkgs { pkgs = import nixpkgs { inherit system overlays; }; }); + inputs.flake-utils.lib.flattenTree (import ./pkgs { + pkgs = import nixpkgs { inherit system overlays; }; + })); # The development environment for this flake. devShell = forAllSystems (system: diff --git a/hosts/ni/default.nix b/hosts/ni/default.nix index 8d0ade99..20cc1b31 100644 --- a/hosts/ni/default.nix +++ b/hosts/ni/default.nix @@ -27,7 +27,7 @@ neovim.enable = true; }; users.users.foo-dogsquared.settings = { - extraGroups = [ "wheel" "audio" "docker" "podman" "network-manager" ]; + extraGroups = [ "wheel" "audio" "docker" "podman" "networkmanager" ]; hashedPassword = "$6$.cMYto0K0CHbpIMT$dRqyKs4q1ppzmTpdzy5FWP/V832a6X..FwM8CJ30ivK0nfLjQ7DubctxOZbeOtygfjcUd1PZ0nQoQpOg/WMvg."; isNormalUser = true; @@ -41,6 +41,10 @@ themes.a-happy-gnome.enable = true; }; + environment.systemPackages = with pkgs; [ + guile_3_0 + ]; + # Enable Guix service. services.guix-binary.enable = true; diff --git a/modules/home-manager/profiles/desktop.nix b/modules/home-manager/profiles/desktop.nix index a92fb442..79fb5734 100644 --- a/modules/home-manager/profiles/desktop.nix +++ b/modules/home-manager/profiles/desktop.nix @@ -39,6 +39,7 @@ in { carla # The Carla Carla. ]; + # This is assuming you're using Pipewire, yes? services.easyeffects.enable = true; services.fluidsynth = { enable = true; diff --git a/modules/home-manager/profiles/dev.nix b/modules/home-manager/profiles/dev.nix index 21897a12..4a30804b 100644 --- a/modules/home-manager/profiles/dev.nix +++ b/modules/home-manager/profiles/dev.nix @@ -9,6 +9,7 @@ in { lib.mkEnableOption "foo-dogsquared's user-specific development setup"; shell.enable = lib.mkEnableOption "configuration of foo-dogsquared's shell of choice"; + extras.enable = lib.mkEnableOption "additional tools for development stuff"; }; config = lib.mkIf cfg.enable (lib.mkMerge [ @@ -37,10 +38,19 @@ in { nix-direnv.enable = true; }; programs.zoxide.enable = true; + + # Enable Starship prompt. programs.starship = { enable = true; settings = { add_newline = false; }; }; }) + + (lib.mkIf cfg.extras.enable { + home.packages = with pkgs; [ + tree-sitter # The modern way of text highlighting. + hyperfine # Command-line profiling. + ]; + }) ]); } diff --git a/modules/home-manager/profiles/editors.nix b/modules/home-manager/profiles/editors.nix index af19f5f6..f69579d9 100644 --- a/modules/home-manager/profiles/editors.nix +++ b/modules/home-manager/profiles/editors.nix @@ -28,7 +28,9 @@ in { (lib.mkIf cfg.emacs.enable { # Doom Emacs dependencies. home.packages = with pkgs; [ - emacs + ((emacsPackagesFor emacs).emacsWithPackages (epkgs: [ + epkgs.vterm + ])) # Required dependencies. ripgrep diff --git a/modules/home-manager/services/bleachbit.nix b/modules/home-manager/services/bleachbit.nix index 52790893..0095242d 100644 --- a/modules/home-manager/services/bleachbit.nix +++ b/modules/home-manager/services/bleachbit.nix @@ -20,6 +20,7 @@ in { description = "Whether to enable persistence for the cleanup, allowing it to activate the next time it boots when missed."; default = true; + defaultText = "true"; example = false; }; @@ -97,7 +98,7 @@ in { PartOf = [ "default.target" ]; }; - Install.WantedBy = [ "default.target" ]; + Install.WantedBy = [ "timers.target" ]; Timer = { OnCalendar = cfg.startAt; diff --git a/users/home-manager/foo-dogsquared/default.nix b/users/home-manager/foo-dogsquared/default.nix index 06e3a971..3de294aa 100644 --- a/users/home-manager/foo-dogsquared/default.nix +++ b/users/home-manager/foo-dogsquared/default.nix @@ -1,12 +1,36 @@ { config, options, lib, pkgs, ... }: -{ +let + yt-dlp-for-audio-config = pkgs.writeText "yt-dlp-for-audio-config" '' + # Don't overwrite for cautious individuals. + --no-overwrite + + # To make sure all audio-related. + --extract-audio + --format bestaudio + --audio-format opus + + --output '%(track_number,playlist_autonumber)d-%(track,title)s.%(ext)s' + --download-archive archive + + # Add all sorts of metadata. + --embed-thumbnail + --add-metadata + ''; + yt-dlp-for-audio = pkgs.writeScriptBin "yt-dlp-audio" '' + ${pkgs.yt-dlp}/bin/yt-dlp --config-location "${yt-dlp-for-audio-config}" $@ + ''; +in { + programs.home-manager.enable = true; + home.packages = with pkgs; [ neovim borgmatic borgbackup ncmpcpp vscodium-fhs + tree-sitter + yt-dlp-for-audio ]; fonts.fontconfig.enable = true; @@ -24,11 +48,44 @@ services.mopidy = { enable = true; extensionPackages = with pkgs; [ + mopidy-beets + mopidy-funkwhale + mopidy-internetarchive + mopidy-iris + mopidy-local mopidy-mpd mopidy-mpris - mopidy-local + mopidy-spotify + mopidy-youtube ]; + configuration = { + http = { + hostname = "0.0.0.0"; + }; + + file = { + enabled = true; + media_dirs = [ + "$XDG_MUSIC_DIR|Music" + ]; + }; + + internetarchive = { + enabled = true; + browse_limit = 150; + search_limit = 150; + collections = [ + "fav-foo-dogsquared" + "audio" + "etree" + "audio_music" + "audio_foreign" + ]; + }; + }; + }; + services.recoll = { enable = true; settings = { @@ -70,11 +127,26 @@ bleachbit.enable = true; }; + # WHOA! Even browsers with extensions can be declarative! + programs.brave = { + enable = true; + extensions = [ + { id = "dbepggeogbaibhgnhhndojpepiihcmeb"; } # Vimium + { id = "ekhagklcjbdpajgpjgmbionohlpdbjgc"; } # Zotero connector + { id = "jfnifeihccihocjbfcfhicmmgpjicaec"; } # GSConnect + { id = "aapbdbdomjkkjkaonfhkkikfgjllcleb"; } # Google Translate (yes, I'm disappointed in myself) + { id = "egpjdkipkomnmjhjmdamaniclmdlobbo"; } # Firenvim + { id = "gknkbkaapnhpmkcgkmdekdffgcddoiel"; } # Open Access Button + { id = "fpnmgdkabkmnadcjpehmlllkndpkmiak"; } # Wayback Machine + ]; + }; + xdg.userDirs = { enable = true; createDirectories = true; - # The XDG base directories. + # The XDG base directories. Most of my setup with this user will be my + # personal computer so I'll set them like so... documents = "$HOME/library/documents"; music = "$HOME/library/music"; pictures = "$HOME/library/pictures";