From 08160eb8278e063bc57d8594f3a89c65a86a4b7f Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 13 Aug 2022 08:31:09 +0800 Subject: [PATCH] misc: update and refactor --- flake.nix | 4 +- lib/private.nix | 4 +- modules/home-manager/profiles/desktop.nix | 1 + modules/home-manager/profiles/dev.nix | 70 +++++++++++++++-------- modules/nixos/profiles/dev.nix | 7 +-- modules/nixos/profiles/system.nix | 2 + 6 files changed, 56 insertions(+), 32 deletions(-) diff --git a/flake.nix b/flake.nix index df156587..647c3766 100644 --- a/flake.nix +++ b/flake.nix @@ -78,7 +78,7 @@ # The order here is important(?). overlays = [ # Put my custom packages to be available. - (final: prev: import ./pkgs { pkgs = prev; }) + self.overlays.default # Putting a list for inputs without overlays. (final: prev: { @@ -134,6 +134,8 @@ inputs.guix-overlay.nixosModules.guix-binary ]; + environment.extraOutputsToInstall = [ "doc" "devdoc" "info" ]; + # Bleeding edge, baybee! nix.package = pkgs.nixUnstable; diff --git a/lib/private.nix b/lib/private.nix index 27ad5a41..8aeb311b 100644 --- a/lib/private.nix +++ b/lib/private.nix @@ -22,10 +22,10 @@ rec { home.homeDirectory = homeDirectory; } - (lib.getUser "home-manager" user) + (getUser "home-manager" user) ]; }; - users.users."${user}" = defaultUserConfig // settings // absoluteOverrides; + users.users."${user}" = defaultUserConfig // settings // absoluteOverrides; }; getSecret = path: ../secrets/${path}; diff --git a/modules/home-manager/profiles/desktop.nix b/modules/home-manager/profiles/desktop.nix index f7d0e9a3..21e14852 100644 --- a/modules/home-manager/profiles/desktop.nix +++ b/modules/home-manager/profiles/desktop.nix @@ -17,6 +17,7 @@ in { home.packages = with pkgs; [ aseprite # Pixel art wannabe tool. blender # 3D modelling wannabe tool. + emulsion-palette # Manage your color palettes. inkscape # Illustration wannabe tool. gimp # Photo editing wannabe tool. krita # Digital art wannabe tool. diff --git a/modules/home-manager/profiles/dev.nix b/modules/home-manager/profiles/dev.nix index b11b6d09..7f8827fb 100644 --- a/modules/home-manager/profiles/dev.nix +++ b/modules/home-manager/profiles/dev.nix @@ -43,34 +43,56 @@ in { "nvim" ]; bashrcExtra = '' - function f() { - dir=''${1:-$PWD} - dest=$(${pkgs.fd}/bin/fd --type directory --hidden --ignore-vcs --base-directory "$dir" \ - | ${pkgs.fzf}/bin/fzf --prompt "Go to directory ") - destPrime=$(${pkgs.coreutils}/bin/realpath --canonicalize-existing --logical "$dir/$dest") + function f() { + dir=''${1:-$PWD} + dest=$(${pkgs.fd}/bin/fd --type directory --ignore-vcs --base-directory "$dir" \ + | ${pkgs.fzf}/bin/fzf --prompt "Go to directory ") + destPrime=$(${pkgs.coreutils}/bin/realpath --canonicalize-existing --logical "$dir/$dest") - [ "$dest" ] && cd "$destPrime" - } + [ "$dest" ] && cd "$destPrime" + } - function ff() { - dir=''${1:-$PWD} - dest=$(${pkgs.fd}/bin/fd --hidden --ignore-vcs --base-directory "$dir" \ - | ${pkgs.fzf}/bin/fzf --prompt "Open file ") - destPrime=$(${pkgs.coreutils}/bin/realpath --canonicalize-existing --logical "$dir/$dest") + function fh() { + dir=''${1:-$PWD} + dest=$(${pkgs.fd}/bin/fd --type directory --hidden --ignore-vcs --base-directory "$dir" \ + | ${pkgs.fzf}/bin/fzf --prompt "Go to directory ") + destPrime=$(${pkgs.coreutils}/bin/realpath --canonicalize-existing --logical "$dir/$dest") - if [ -d "$destPrime" ]; then - [ "$dest" ] && cd "$destPrime"; - else - [ "$dest" ] && ${pkgs.xdg-utils}/bin/xdg-open "$destPrime"; - fi - } + [ "$dest" ] && cd "$destPrime" + } - function fm() { - ${pkgs.man}/bin/man -k . \ - | ${pkgs.fzf}/bin/fzf --multi --prompt "Open manpage(s) " \ - | ${pkgs.gawk}/bin/awk '{ print $1 "." gensub(/[()]/, "", "g", $2) }' \ - | ${pkgs.findutils}/bin/xargs man - } + function ff() { + dir=''${1:-$PWD} + dest=$(${pkgs.fd}/bin/fd --ignore-vcs --base-directory "$dir" \ + | ${pkgs.fzf}/bin/fzf --prompt "Open file ") + destPrime=$(${pkgs.coreutils}/bin/realpath --canonicalize-existing --logical "$dir/$dest") + + if [ -d "$destPrime" ]; then + [ "$dest" ] && cd "$destPrime"; + else + [ "$dest" ] && ${pkgs.xdg-utils}/bin/xdg-open "$destPrime"; + fi + } + + function ffh() { + dir=''${1:-$PWD} + dest=$(${pkgs.fd}/bin/fd --hidden --ignore-vcs --base-directory "$dir" \ + | ${pkgs.fzf}/bin/fzf --prompt "Open file ") + destPrime=$(${pkgs.coreutils}/bin/realpath --canonicalize-existing --logical "$dir/$dest") + + if [ -d "$destPrime" ]; then + [ "$dest" ] && cd "$destPrime"; + else + [ "$dest" ] && ${pkgs.xdg-utils}/bin/xdg-open "$destPrime"; + fi + } + + function fm() { + ${pkgs.man}/bin/man -k . \ + | ${pkgs.fzf}/bin/fzf --multi --prompt "Open manpage(s) " \ + | ${pkgs.gawk}/bin/awk '{ print $1 "." gensub(/[()]/, "", "g", $2) }' \ + | ${pkgs.findutils}/bin/xargs man + } ''; }; programs.atuin = { diff --git a/modules/nixos/profiles/dev.nix b/modules/nixos/profiles/dev.nix index 49077337..b6af5e27 100644 --- a/modules/nixos/profiles/dev.nix +++ b/modules/nixos/profiles/dev.nix @@ -86,11 +86,8 @@ in { virt-manager ]; - # Enable podman just as my main container runtime or something. - virtualisation.podman = { - enable = true; - dockerCompat = true; - }; + # Enable Docker just as my main container runtime or something. + virtualisation.docker.enable = true; # Enable libvirt for muh qemu. virtualisation.libvirtd = { diff --git a/modules/nixos/profiles/system.nix b/modules/nixos/profiles/system.nix index cab89355..32311f37 100644 --- a/modules/nixos/profiles/system.nix +++ b/modules/nixos/profiles/system.nix @@ -44,6 +44,8 @@ in { serviceConfig.Type = "oneshot"; }; + programs.extra-container.enable = true; + # Enable font-related options for more smoother and consistent experience. fonts.fontconfig.enable = true;