diff --git a/flake.nix b/flake.nix deleted file mode 100644 index 228c405..0000000 --- a/flake.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ - description = "pfke nix config"; - - inputs = { - # Go back to nixos-unstable after PR 238700 is merged - # https://nixpk.gs/pr-tracker.html?pr=238700 - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small"; - # You can access packages and modules from different nixpkgs revs - # at the same time. Here's an working example: - nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; - - hardware.url = "github:nixos/nixos-hardware"; - nix-colors.url = "github:misterio77/nix-colors"; - - # Home manager - home-manager = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; - - outputs = { self, nixpkgs, home-manager, ... }@inputs: - let - inherit (self) outputs; - lib = nixpkgs.lib // home-manager.lib; - systems = [ "aarch64-linux" "i686-linux" "x86_64-linux" ]; - forEachSystem = f: lib.genAttrs systems (sys: f pkgsFor.${sys}); - pkgsFor = nixpkgs.legacyPackages; - in - { - inherit lib; - nixosModules = import ./modules/nixos; - homeManagerModules = import ./modules/home-manager; - templates = import ./templates; - - overlays = import ./overlays { inherit inputs outputs; }; - hydraJobs = import ./hydra.nix { inherit inputs outputs; }; - - packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; }); - devShells = forEachSystem (pkgs: import ./shell.nix { inherit pkgs; }); - formatter = forEachSystem (pkgs: pkgs.nixpkgs-fmt); - - wallpapers = import ./home/misterio/wallpapers; - - nixosConfigurations = { - # Main desktop - atlas = lib.nixosSystem { - modules = [ ./hosts/atlas ]; - specialArgs = { inherit inputs outputs; }; - }; - # ... - }; - - homeConfigurations = { - "hblobner@devvie" = lib.homeManagerConfiguration { - modules = [ ./users/hblober_at_devvie.nix ]; - pkgs = pkgsFor.x86_64-linux; - extraSpecialArgs = { inherit inputs outputs; }; - }; - }; - }; -} diff --git a/hblobner_at_devvie.nix b/hblobner_at_devvie.nix new file mode 100644 index 0000000..921c658 --- /dev/null +++ b/hblobner_at_devvie.nix @@ -0,0 +1,33 @@ +{ config, pkgs, ... }: + +{ + # Home Manager needs a bit of information about you and the + # paths it should manage. + home.username = "hblobner"; + home.homeDirectory = "/home/hblobner"; + + # Packages that should be installed to the user profile. + home.packages = [ + pkgs.htop + pkgs.fortune + ]; + + # This value determines the Home Manager release that your + # configuration is compatible with. This helps avoid breakage + # when a new Home Manager release introduces backwards + # incompatible changes. + # + # You can update Home Manager without changing this value. See + # the Home Manager release notes for a list of state version + # changes in each release. + home.stateVersion = "23.05"; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + + services.gpg-agent = { + enable = true; + defaultCacheTtl = 1800; + enableSshSupport = true; + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix deleted file mode 100644 index 173d701..0000000 --- a/pkgs/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs ? import { } }: rec { - - # Packages with an actual source - speedtestpp = pkgs.callPackage ./speedtestpp { }; -} - diff --git a/pkgs/speedtestpp/default.nix b/pkgs/speedtestpp/default.nix deleted file mode 100644 index a6c3d56..0000000 --- a/pkgs/speedtestpp/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ stdenv, lib, fetchFromGitHub, cmake, curl, openssl, libxml2 }: -stdenv.mkDerivation rec { - pname = "speedtestpp"; - version = "2021-08-29"; - src = fetchFromGitHub { - owner = "taganaka"; - repo = "speedtest"; - rev = "0f63cfbf7ce8d64ea803bf143b957eae76323405"; - sha256 = "sha256-rGY0kK2OCZl+229/JERf2ghBSdvAedhVuL4SrVzYFmU="; - }; - nativeBuildInputs = [ cmake curl openssl libxml2 ]; - postInstall = '' - ln -s $out/bin/SpeedTest $out/bin/speedtestpp - ''; - - meta = with lib; { - description = "Unofficial speedtest.net cli using raw TCP for better accuracy"; - homepage = "https://github.com/taganaka/SpeedTest"; - license = licenses.mit; - platforms = platforms.linux; - }; -} - diff --git a/users/features/cli/bat.nix b/users/features/cli/bat.nix deleted file mode 100644 index 145895e..0000000 --- a/users/features/cli/bat.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - programs.bat = { - enable = true; - config.theme = "base16"; - }; -} diff --git a/users/features/cli/default.nix b/users/features/cli/default.nix deleted file mode 100644 index 9091360..0000000 --- a/users/features/cli/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ pkgs, ... }: { - imports = [ - ./bat.nix - ./direnv.nix - ./gh.nix - ./git.nix - ./gpg.nix - ./nix-index.nix - ./pfetch.nix - ./ranger.nix - ./screen.nix - ./shellcolor.nix - ./ssh.nix - ./starship.nix - ]; - home.packages = with pkgs; [ - comma # Install and run programs by sticking a , before them - distrobox # Nice escape hatch, integrates docker images with my environment - - bc # Calculator - bottom # System viewer - ncdu # TUI disk usage - exa # Better ls - ripgrep # Better grep - fd # Better find - httpie # Better curl - diffsitter # Better diff - jq # JSON pretty printer and manipulator - trekscii # Cute startrek cli printer - - nil # Nix LSP - nixfmt # Nix formatter - - ltex-ls # Spell checking LSP - ]; -} diff --git a/users/features/cli/direnv.nix b/users/features/cli/direnv.nix deleted file mode 100644 index 2b51c9d..0000000 --- a/users/features/cli/direnv.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - programs.direnv = { - enable = true; - nix-direnv.enable = true; - }; -} diff --git a/users/features/cli/gh.nix b/users/features/cli/gh.nix deleted file mode 100644 index b810f03..0000000 --- a/users/features/cli/gh.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ pkgs, ... }: -{ - programs.gh = { - enable = true; - extensions = with pkgs; [ gh-markdown-preview ]; - settings = { - git_protocol = "ssh"; - prompt = "enabled"; - }; - }; - home.persistence = { - "/persist/home/${config.home.username}".directories = [ ".config/gh" ]; - }; -} diff --git a/users/features/cli/git.nix b/users/features/cli/git.nix deleted file mode 100644 index c7ead0f..0000000 --- a/users/features/cli/git.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ pkgs, lib, config, ... }: -let - ssh = "${pkgs.openssh}/bin/ssh"; - - git-m7 = pkgs.writeShellScriptBin "git-m7" '' - repo="$(git remote -v | grep git@m7.rs | head -1 | cut -d ':' -f2 | cut -d ' ' -f1)" - # Add a .git suffix if it's missing - if [[ "$repo" != *".git" ]]; then - repo="$repo.git" - fi - - if [ "$1" == "init" ]; then - if [ "$2" == "" ]; then - echo "You must specify a name for the repo" - exit 1 - fi - ${ssh} -A git@m7.rs << EOF - git init --bare "$2.git" - git -C "$2.git" branch -m main - EOF - git remote add origin git@m7.rs:"$2.git" - elif [ "$1" == "ls" ]; then - ${ssh} -A git@m7.rs ls - else - ${ssh} -A git@m7.rs git -C "/srv/git/$repo" $@ - fi - ''; -in -{ - home.packages = [ git-m7 ]; - programs.git = { - enable = true; - package = pkgs.gitAndTools.gitFull; - aliases = { - pushall = "!git remote | xargs -L1 git push --all"; - graph = "log --decorate --oneline --graph"; - add-nowhitespace = "!git diff -U0 -w --no-color | git apply --cached --ignore-whitespace --unidiff-zero -"; - }; - userName = "Gabriel Fontes"; - userEmail = "hi@m7.rs"; - extraConfig = { - feature.manyFiles = true; - init.defaultBranch = "main"; - user.signing.key = "CE707A2C17FAAC97907FF8EF2E54EA7BFE630916"; - commit.gpgSign = true; - gpg.program = "${config.programs.gpg.package}/bin/gpg2"; - }; - lfs.enable = true; - ignores = [ ".direnv" "result" ]; - }; -} diff --git a/users/features/cli/gpg-commands.nix b/users/features/cli/gpg-commands.nix deleted file mode 100644 index 65d9df6..0000000 --- a/users/features/cli/gpg-commands.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs, ... }: - -let - ssh = "${pkgs.openssh}/bin/ssh"; - gpg-connect-agent = "${pkgs.gnupg}/bin/gpg-connect-agent"; -in -{ - isUnlocked = "${pkgs.procps}/bin/pgrep 'gpg-agent' &> /dev/null && ${gpg-connect-agent} 'scd getinfo card_list' /bye | ${pkgs.gnugrep}/bin/grep SERIALNO -q"; - unlock = "${ssh} -T localhost -o StrictHostKeyChecking=no exit"; -} diff --git a/users/features/cli/gpg.nix b/users/features/cli/gpg.nix deleted file mode 100644 index 7420281..0000000 --- a/users/features/cli/gpg.nix +++ /dev/null @@ -1,66 +0,0 @@ -{ pkgs, config, lib, ... }: -let - pinentry = - if config.gtk.enable then { - packages = [ pkgs.pinentry-gnome pkgs.gcr ]; - name = "gnome3"; - } else { - packages = [ pkgs.pinentry-curses ]; - name = "curses"; - }; -in -{ - home.packages = pinentry.packages; - - services.gpg-agent = { - enable = true; - enableSshSupport = true; - sshKeys = [ "149F16412997785363112F3DBD713BC91D51B831" ]; - pinentryFlavor = pinentry.name; - enableExtraSocket = true; - }; - - programs = - let - fixGpg = '' - gpgconf --launch gpg-agent - ''; - in - { - # Start gpg-agent if it's not running or tunneled in - # SSH does not start it automatically, so this is needed to avoid having to use a gpg command at startup - # https://www.gnupg.org/faq/whats-new-in-2.1.html#autostart - bash.profileExtra = fixGpg; - fish.loginShellInit = fixGpg; - zsh.loginExtra = fixGpg; - - gpg = { - enable = true; - settings = { - trust-model = "tofu+pgp"; - }; - publicKeys = [{ - source = ../../pgp.asc; - trust = 5; - }]; - }; - }; - - systemd.user.services = { - # Link /run/user/$UID/gnupg to ~/.gnupg-sockets - # So that SSH config does not have to know the UID - link-gnupg-sockets = { - Unit = { - Description = "link gnupg sockets from /run to /home"; - }; - Service = { - Type = "oneshot"; - ExecStart = "${pkgs.coreutils}/bin/ln -Tfs /run/user/%U/gnupg %h/.gnupg-sockets"; - ExecStop = "${pkgs.coreutils}/bin/rm $HOME/.gnupg-sockets"; - RemainAfterExit = true; - }; - Install.WantedBy = [ "default.target" ]; - }; - }; -} -# vim: filetype=nix diff --git a/users/features/cli/nix-index.nix b/users/features/cli/nix-index.nix deleted file mode 100644 index b35a4f6..0000000 --- a/users/features/cli/nix-index.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ pkgs, ... }: -let - update-script = pkgs.writeShellApplication { - name = "fetch-nix-index-database"; - runtimeInputs = with pkgs; [ wget coreutils ]; - text = '' - filename="index-x86_64-linux" - mkdir -p ~/.cache/nix-index - cd ~/.cache/nix-index - wget -N "https://github.com/Mic92/nix-index-database/releases/latest/download/$filename" - ln -f "$filename" files - ''; - }; -in -{ - programs.nix-index.enable = true; - - systemd.user.services.nix-index-database-sync = { - Unit = { Description = "fetch mic92/nix-index-database"; }; - Service = { - Type = "oneshot"; - ExecStart = "${update-script}/bin/fetch-nix-index-database"; - Restart = "on-failure"; - RestartSec = "5m"; - }; - }; - systemd.user.timers.nix-index-database-sync = { - Unit = { Description = "Automatic github:mic92/nix-index-database fetching"; }; - Timer = { - OnBootSec = "10m"; - OnUnitActiveSec = "24h"; - }; - Install = { WantedBy = [ "timers.target" ]; }; - }; -} diff --git a/users/features/cli/pfetch.nix b/users/features/cli/pfetch.nix deleted file mode 100644 index e5e4b36..0000000 --- a/users/features/cli/pfetch.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, ... }: -{ - home = { - packages = with pkgs; [ pfetch ]; - sessionVariables.PF_INFO = - "ascii title os kernel uptime shell term desktop scheme palette"; - }; -} diff --git a/users/features/cli/ranger.nix b/users/features/cli/ranger.nix deleted file mode 100644 index e6eac89..0000000 --- a/users/features/cli/ranger.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ pkgs, ... }: { - home.packages = with pkgs; [ ranger ]; -} diff --git a/users/features/cli/screen.nix b/users/features/cli/screen.nix deleted file mode 100644 index fddc7a8..0000000 --- a/users/features/cli/screen.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, ... }: { - home.packages = [ pkgs.screen ]; - home.file.".screenrc".text = '' - startup_message off - defbce on - setenv TERM xterm-256color - ''; -} diff --git a/users/features/cli/shellcolor.nix b/users/features/cli/shellcolor.nix deleted file mode 100644 index 7d99a80..0000000 --- a/users/features/cli/shellcolor.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ config, ... }: -let inherit (config.colorscheme) colors; -in { - programs.shellcolor = { - enable = true; - settings = { - base00 = "${colors.base00}"; - base01 = "${colors.base01}"; - base02 = "${colors.base02}"; - base03 = "${colors.base03}"; - base04 = "${colors.base04}"; - base05 = "${colors.base05}"; - base06 = "${colors.base06}"; - base07 = "${colors.base07}"; - base08 = "${colors.base08}"; - base09 = "${colors.base09}"; - base0A = "${colors.base0A}"; - base0B = "${colors.base0B}"; - base0C = "${colors.base0C}"; - base0D = "${colors.base0D}"; - base0E = "${colors.base0E}"; - base0F = "${colors.base0F}"; - }; - }; -} diff --git a/users/features/cli/ssh.nix b/users/features/cli/ssh.nix deleted file mode 100644 index fd57e01..0000000 --- a/users/features/cli/ssh.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ outputs, lib, ... }: -let - hostnames = builtins.attrNames outputs.nixosConfigurations; -in -{ - programs.ssh = { - enable = true; - matchBlocks = { - net = { - host = builtins.concatStringsSep " " hostnames; - forwardAgent = true; - remoteForwards = [{ - bind.address = ''/%d/.gnupg-sockets/S.gpg-agent''; - host.address = ''/%d/.gnupg-sockets/S.gpg-agent.extra''; - }]; - }; - trusted = lib.hm.dag.entryBefore [ "net" ] { - host = "m7.rs *.m7.rs *.ts.m7.rs"; - forwardAgent = true; - }; - }; - }; - - home.persistence = { - "/persist/home/${config.home.username}".directories = [ ".ssh" ]; - }; -} diff --git a/users/features/cli/starship.nix b/users/features/cli/starship.nix deleted file mode 100644 index 30c3fca..0000000 --- a/users/features/cli/starship.nix +++ /dev/null @@ -1,133 +0,0 @@ -{ pkgs, ... }: -let - nix-inspect = pkgs.writeShellScriptBin "nix-inspect" '' - read -ra EXCLUDED <<< "$@" - EXCLUDED+=(''${NIX_INSPECT_EXCLUDE[@]:-}) - - IFS=":" read -ra PATHS <<< "$PATH" - - read -ra PROGRAMS <<< \ - "$(printf "%s\n" "''${PATHS[@]}" | ${pkgs.gnugrep}/bin/grep "\/nix\/store" | ${pkgs.gnugrep}/bin/grep -v "\-man" | ${pkgs.perl}/bin/perl -pe 's/^\/nix\/store\/\w{32}-([^\/]*)\/bin$/\1/' | ${pkgs.findutils}/bin/xargs)" - - for to_remove in "''${EXCLUDED[@]}"; do - to_remove_full="$(printf "%s\n" "''${PROGRAMS[@]}" | grep "$to_remove" )" - PROGRAMS=("''${PROGRAMS[@]/$to_remove_full}") - done - - read -ra PROGRAMS <<< "''${PROGRAMS[@]}" - echo "''${PROGRAMS[@]}" - ''; -in -{ - programs.starship = { - enable = true; - settings = { - format = - let - git = "$git_branch$git_commit$git_state$git_status"; - cloud = "$aws$gcloud$openstack"; - in - '' - $username$hostname($shlvl)($cmd_duration) $fill ($nix_shell)$custom - $directory(${git})(- ${cloud}) $fill $time - $jobs$character - ''; - - fill = { - symbol = " "; - disabled = false; - }; - - # Core - username = { - format = "[$user]($style)"; - show_always = true; - }; - hostname = { - format = "[@$hostname]($style) "; - ssh_only = false; - style = "bold green"; - }; - shlvl = { - format = "[$shlvl]($style) "; - style = "bold cyan"; - threshold = 2; - repeat = true; - disabled = false; - }; - cmd_duration = { - format = "took [$duration]($style) "; - }; - - directory = { - format = "[$path]($style)( [$read_only]($read_only_style)) "; - }; - nix_shell = { - format = "[($name \\(develop\\) <- )$symbol]($style) "; - impure_msg = ""; - symbol = " "; - style = "bold red"; - }; - custom = { - nix_inspect = { - disabled = false; - when = "test -z $IN_NIX_SHELL"; - command = "${nix-inspect}/bin/nix-inspect kitty imagemagick ncurses user-environment"; - format = "[($output <- )$symbol]($style) "; - symbol = " "; - style = "bold blue"; - }; - }; - - character = { - error_symbol = "[~~>](bold red)"; - success_symbol = "[->>](bold green)"; - vimcmd_symbol = "[<<-](bold yellow)"; - vimcmd_visual_symbol = "[<<-](bold cyan)"; - vimcmd_replace_symbol = "[<<-](bold purple)"; - vimcmd_replace_one_symbol = "[<<-](bold purple)"; - }; - - time = { - format = "\\\[[$time]($style)\\\]"; - disabled = false; - }; - - # Cloud - gcloud = { - format = "on [$symbol$active(/$project)(\\($region\\))]($style)"; - }; - aws = { - format = "on [$symbol$profile(\\($region\\))]($style)"; - }; - - # Icon changes only \/ - aws.symbol = " "; - conda.symbol = " "; - dart.symbol = " "; - directory.read_only = " "; - docker_context.symbol = " "; - elixir.symbol = " "; - elm.symbol = " "; - gcloud.symbol = " "; - git_branch.symbol = " "; - golang.symbol = " "; - hg_branch.symbol = " "; - java.symbol = " "; - julia.symbol = " "; - memory_usage.symbol = "󰍛 "; - nim.symbol = "󰆥 "; - nodejs.symbol = " "; - package.symbol = "󰏗 "; - perl.symbol = " "; - php.symbol = " "; - python.symbol = " "; - ruby.symbol = " "; - rust.symbol = " "; - scala.symbol = " "; - shlvl.symbol = ""; - swift.symbol = "󰛥 "; - terraform.symbol = "󱁢"; - }; - }; -} diff --git a/users/features/pass/default.nix b/users/features/pass/default.nix deleted file mode 100644 index 763e97c..0000000 --- a/users/features/pass/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ pkgs, config, ... }: { - programs.password-store = { - enable = true; - settings = { PASSWORD_STORE_DIR = "$HOME/.password-store"; }; - package = pkgs.pass.withExtensions (p: [ p.pass-otp ]); - }; - - services.pass-secret-service = { - enable = true; - storePath = "${config.home.homeDirectory}/.password-store"; - extraArgs = [ "-e${config.programs.password-store.package}/bin/pass" ]; - }; - - home.persistence = { - "/persist/home/misterio".directories = [ ".password-store" ]; - }; -} diff --git a/users/features/productivity/default.nix b/users/features/productivity/default.nix deleted file mode 100644 index d41f3ab..0000000 --- a/users/features/productivity/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - imports = [ - # Pass feature is required - ../pass - ]; -} diff --git a/users/global/default.nix b/users/global/default.nix deleted file mode 100644 index d144fca..0000000 --- a/users/global/default.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ inputs, lib, pkgs, config, outputs, ... }: -let - inherit (inputs.nix-colors) colorSchemes; - inherit (inputs.nix-colors.lib-contrib { inherit pkgs; }) colorschemeFromPicture nixWallpaperFromScheme; -in -{ - imports = [ - inputs.impermanence.nixosModules.home-manager.impermanence - inputs.nix-colors.homeManagerModule - ../features/cli - ../features/nvim - ../features/helix - ] ++ (builtins.attrValues outputs.homeManagerModules); - - nixpkgs = { - overlays = builtins.attrValues outputs.overlays; - config = { - allowUnfree = true; - allowUnfreePredicate = (_: true); - }; - }; - - nix = { - package = lib.mkDefault pkgs.nix; - settings = { - experimental-features = [ "nix-command" "flakes" "repl-flake" ]; - warn-dirty = false; - }; - }; - - programs = { - home-manager.enable = true; - git.enable = true; - }; - - home = { - homeDirectory = lib.mkDefault "/home/${config.home.username}"; - stateVersion = lib.mkDefault "22.05"; - sessionPath = [ "$HOME/.local/bin" ]; - - persistence = { - "/persist/home/${config.home.username}" = { - directories = [ - "Documents" - "Downloads" - "Pictures" - "Videos" - ".local/bin" - ]; - allowOther = true; - }; - }; - }; - - colorscheme = lib.mkDefault colorSchemes.dracula; - home.file.".colorscheme".text = config.colorscheme.slug; -} - diff --git a/users/hblobner_at_devvie.nix b/users/hblobner_at_devvie.nix deleted file mode 100644 index 3a45b29..0000000 --- a/users/hblobner_at_devvie.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ inputs, ... }: { - imports = [ - ./global - ./features/cli - ./features/productivity - ./features/pass - ]; - - home = { - username = lib.mkDefault "hblobner"; - }; - - colorscheme = inputs.nix-colors.colorSchemes.catppuccin-macchiato; -}