From 35e84fade230232590883489828acf822af10cc1 Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Sun, 9 Jun 2024 09:33:23 +0200 Subject: [PATCH] Add more scripts, more cleanup --- homes/x86_64-linux/julian@aspi/default.nix | 1 + .../x86_64-linux/julian@kardorf/packages.nix | 1 - modules/home/alacritty/default.nix | 9 ++-- modules/home/fish/default.nix | 7 +++ modules/home/neovim/default.nix | 51 ++++++++++--------- modules/home/non-nixos/default.nix | 33 ++++++++++++ systems/x86_64-linux/kardorf/default.nix | 5 +- 7 files changed, 74 insertions(+), 33 deletions(-) create mode 100644 modules/home/non-nixos/default.nix diff --git a/homes/x86_64-linux/julian@aspi/default.nix b/homes/x86_64-linux/julian@aspi/default.nix index 025ffbd..b859886 100644 --- a/homes/x86_64-linux/julian@aspi/default.nix +++ b/homes/x86_64-linux/julian@aspi/default.nix @@ -27,6 +27,7 @@ home.stateVersion = "23.11"; modules = { + non-nixos.is-nxos = false; shell = { # zsh.enable = true; fish.enable = true; diff --git a/homes/x86_64-linux/julian@kardorf/packages.nix b/homes/x86_64-linux/julian@kardorf/packages.nix index 56aedf6..27a3ae4 100644 --- a/homes/x86_64-linux/julian@kardorf/packages.nix +++ b/homes/x86_64-linux/julian@kardorf/packages.nix @@ -68,7 +68,6 @@ with pkgs; doublecmd mucommander tree - alacritty wezterm kitty bat diff --git a/modules/home/alacritty/default.nix b/modules/home/alacritty/default.nix index 8ad9b68..b3ef74e 100644 --- a/modules/home/alacritty/default.nix +++ b/modules/home/alacritty/default.nix @@ -19,19 +19,16 @@ ... }: -with lib; - let cfg = config.modules.alacritty; in { options.modules.alacritty = { - enable = mkOption { default = false; }; + enable = lib.mkOption { default = false; }; }; - config = mkIf cfg.enable { - # Does not work on non-nixos due to opengl - # home.packages = with pkgs; [ alacritty ]; + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ (lib.mkIf config.modules.non-nixos.is-nixos alacritty) ]; home.file = { ".config/alacritty/theme".source = "${inputs.alacritty-theme}"; diff --git a/modules/home/fish/default.nix b/modules/home/fish/default.nix index 8fc0733..c9a4197 100644 --- a/modules/home/fish/default.nix +++ b/modules/home/fish/default.nix @@ -77,6 +77,13 @@ in run = '' nix run nixpkgs#"$argv[1]" -- $argv[2..-1] ''; + shell = '' + set args + for arg in $argv + set args $args nixpkgs#$arg + end + nix shell $args + ''; }; }; }; diff --git a/modules/home/neovim/default.nix b/modules/home/neovim/default.nix index 0521231..380a1ff 100644 --- a/modules/home/neovim/default.nix +++ b/modules/home/neovim/default.nix @@ -1,28 +1,33 @@ { -# Snowfall Lib provides a customized `lib` instance with access to your flake's library -# as well as the libraries available from your flake's inputs. -lib, -# An instance of `pkgs` with your overlays and packages applied is also available. -pkgs, -# You also have access to your flake's inputs. -inputs, + # Snowfall Lib provides a customized `lib` instance with access to your flake's library + # as well as the libraries available from your flake's inputs. + lib, + # An instance of `pkgs` with your overlays and packages applied is also available. + pkgs, + # You also have access to your flake's inputs. + inputs, -# Additional metadata is provided by Snowfall Lib. -system, # The system architecture for this host (eg. `x86_64-linux`). -target, # The Snowfall Lib target for this system (eg. `x86_64-iso`). -format, # A normalized name for the system target (eg. `iso`). -virtual -, # A boolean to determine whether this system is a virtual target using nixos-generators. -systems, # An attribute map of your defined hosts. + # Additional metadata is provided by Snowfall Lib. + system, # The system architecture for this host (eg. `x86_64-linux`). + target, # The Snowfall Lib target for this system (eg. `x86_64-iso`). + format, # A normalized name for the system target (eg. `iso`). + virtual, # A boolean to determine whether this system is a virtual target using nixos-generators. + systems, # An attribute map of your defined hosts. -# All other arguments come from the module system. -config, ... }: + # All other arguments come from the module system. + config, + ... +}: with lib; -let cfg = config.modules.neovim; -in { - options.modules.neovim = { enable = mkOption { default = false; }; }; +let + cfg = config.modules.neovim; +in +{ + options.modules.neovim = { + enable = mkOption { default = false; }; + }; config = mkIf cfg.enable { home.sessionVariables = { @@ -30,13 +35,15 @@ in { VISUAL = "nvim"; }; - programs.neovim = let + programs.neovim = + let toLua = str: '' lua << EOF ${str} EOF ''; - in { + in + { # https://www.youtube.com/watch?v=YZAnJ0rwREA enable = true; viAlias = true; @@ -76,8 +83,6 @@ in { extraLuaConfig = '' vim.o.termguicolors = true ''; - }; - }; }; } diff --git a/modules/home/non-nixos/default.nix b/modules/home/non-nixos/default.nix new file mode 100644 index 0000000..a3db1c4 --- /dev/null +++ b/modules/home/non-nixos/default.nix @@ -0,0 +1,33 @@ +{ + # Snowfall Lib provides a customized `lib` instance with access to your flake's library + # as well as the libraries available from your flake's inputs. + lib, + # An instance of `pkgs` with your overlays and packages applied is also available. + pkgs, + # You also have access to your flake's inputs. + inputs, + + # Additional metadata is provided by Snowfall Lib. + system, # The system architecture for this host (eg. `x86_64-linux`). + target, # The Snowfall Lib target for this system (eg. `x86_64-iso`). + format, # A normalized name for the system target (eg. `iso`). + virtual, # A boolean to determine whether this system is a virtual target using nixos-generators. + systems, # An attribute map of your defined hosts. + + # All other arguments come from the module system. + config, + ... +}: + +with lib; + +let + cfg = config.modules.non-nixos; +in +{ + options.modules.non-nixos = { + is-nixos = mkOption { default = true; }; + }; + + config = mkIf cfg.is-nixos { }; +} diff --git a/systems/x86_64-linux/kardorf/default.nix b/systems/x86_64-linux/kardorf/default.nix index a2e2f02..275bb7e 100644 --- a/systems/x86_64-linux/kardorf/default.nix +++ b/systems/x86_64-linux/kardorf/default.nix @@ -164,8 +164,8 @@ packages = with pkgs; [ ]; # Using home-manager instead }; - home-manager.useGlobalPkgs = true; # make overlays for nixpkgs work for home-manager, not only the system - home-manager.useUserPackages = true; + # home-manager.useGlobalPkgs = true; # make overlays for nixpkgs work for home-manager, not only the system + # home-manager.useUserPackages = true; programs.fish.enable = true; programs.zsh.enable = true; @@ -219,7 +219,6 @@ vim htop mc - home-manager ]; virtualisation.docker.enable = true;