diff --git a/nix/flake.lock b/nix/flake.lock index 2dbe1ea2..bccc7f63 100644 --- a/nix/flake.lock +++ b/nix/flake.lock @@ -216,6 +216,21 @@ "type": "github" } }, + "nix-flatpak": { + "locked": { + "lastModified": 1721549352, + "narHash": "sha256-nlXJa8RSOX0kykrIYW33ukoHYq+FOSNztHLLgqKwOp8=", + "owner": "gmodena", + "repo": "nix-flatpak", + "rev": "dbce39ea8664820ba9037caaf1e2fad365ed6b4b", + "type": "github" + }, + "original": { + "owner": "gmodena", + "repo": "nix-flatpak", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1725930920, @@ -268,6 +283,7 @@ "inputs": { "home-manager": "home-manager", "hyprland": "hyprland", + "nix-flatpak": "nix-flatpak", "nixpkgs": "nixpkgs", "nixpkgs-stable": "nixpkgs-stable", "nixpkgs-unstable": "nixpkgs-unstable" diff --git a/nix/flake.nix b/nix/flake.nix index 156f8caa..81cd885e 100644 --- a/nix/flake.nix +++ b/nix/flake.nix @@ -8,6 +8,7 @@ hyprland.inputs.nixpkgs.follows = "nixpkgs-unstable"; home-manager.url = "github:nix-community/home-manager/release-24.05"; home-manager.inputs.nixpkgs.follows = "nixpkgs-stable"; + nix-flatpak.url = "github:gmodena/nix-flatpak"; }; outputs = { self, @@ -16,6 +17,7 @@ nixpkgs-unstable, home-manager, hyprland, + nix-flatpak, ... }@inputs: let @@ -31,6 +33,7 @@ ./nixos/configuration.nix inputs.home-manager.nixosModules.default inputs.hyprland.nixosModules.default + nix-flatpak.nixosModules.nix-flatpak ]; }; }; diff --git a/nix/home-manager/home.nix b/nix/home-manager/home.nix index dffab056..77deb6b9 100644 --- a/nix/home-manager/home.nix +++ b/nix/home-manager/home.nix @@ -4,20 +4,25 @@ home.username = "joey"; home.homeDirectory = "/home/joey"; home.stateVersion = "24.05"; - home.packages = [ - pkgs.fastfetch - pkgs.tree - pkgs.wl-clipboard + home.packages = with pkgs; [ + fastfetch + tree + wl-clipboard + fzf + fd + flatpak + kdeconnect ]; home.file = {}; - home.sessionVariables = {}; # Programs + ## Hyprland programs.kitty.enable = true; #wayland.windowManager.hyprland = { # enable = true; #}; - + + ## Git programs.git = { enable = true; userName = "Joey Hafner"; @@ -26,7 +31,8 @@ core.sshCommand = "ssh -i /home/joey/.ssh/joey@joey-laptop"; }; }; - + + ## Zsh programs.zsh = { enable = true; dotDir = ".config/zsh"; @@ -57,10 +63,21 @@ bindkey '^[w' kill-region # Delete bindkey '^I^I' autosuggest-accept # Tab, Tab bindkey '^[' autosuggest-clear # Esc + eval "$(fzf --zsh)" + export FZF_DEFAULT_COMMAND="fd --hidden --strip-cwd-prefix --exclude .git" + export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" + export FZF_ALT_C_COMMAND="fd --type=d --hidden --strip-cwd-prefix --exclude .git" + _fzf_compgen_path() { + fd --hidden --exclude .git . "$1" + } + _fzf_compgen_dir() { + fd --hidden --exclude .git . "$1" + } ''; }; - + + ## Home-manager programs.home-manager = { enable = true; }; diff --git a/nix/nixos/configuration.nix b/nix/nixos/configuration.nix index 509d6c06..0cc2fc21 100644 --- a/nix/nixos/configuration.nix +++ b/nix/nixos/configuration.nix @@ -4,15 +4,17 @@ imports = [ ./hardware-configuration.nix + ./flatpak.nix ]; + environment.etc."current-system-packages".text = let packages = builtins.map (p: "${ p.name }") config.environment.systemPackages; sortedUnique = builtins.sort builtins.lessThan (pkgs.lib.lists.unique packages); formatted = builtins.concatStringsSep "\n" sortedUnique; in - formatted; - + formatted; + security.sudo = { enable = true; extraRules = [{ diff --git a/nix/nixos/flatpak.nix b/nix/nixos/flatpak.nix new file mode 100644 index 00000000..efb5f49d --- /dev/null +++ b/nix/nixos/flatpak.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: + +{ + services.flatpak.enable = true; + services.flatpak.packages = [ { appId = "io.github.zen_browser.zen"; origin = "flathub"; } ]; + services.flatpak.update.onActivation = true; +}