From b04a5236452cb71d97cd7c237deaab79c68edd0e Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Thu, 1 Feb 2024 12:52:59 +0100 Subject: [PATCH] make module imports like recommended by snowfall --- modules/home/alacritty/default.nix | 20 +++++++++++++++++++- modules/home/direnv/default.nix | 20 +++++++++++++++++++- modules/home/i3/default.nix | 20 +++++++++++++++++++- modules/home/neovim/default.nix | 20 +++++++++++++++++++- modules/home/rofi/default.nix | 20 +++++++++++++++++++- modules/home/topgrade/default.nix | 20 +++++++++++++++++++- modules/home/zsh/default.nix | 20 +++++++++++++++++++- modules/template.nix | 2 ++ 8 files changed, 135 insertions(+), 7 deletions(-) diff --git a/modules/home/alacritty/default.nix b/modules/home/alacritty/default.nix index c135472..88abda7 100644 --- a/modules/home/alacritty/default.nix +++ b/modules/home/alacritty/default.nix @@ -1,4 +1,22 @@ -{ config, lib, pkgs, 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. + +# All other arguments come from the module system. +config, ... }: with lib; diff --git a/modules/home/direnv/default.nix b/modules/home/direnv/default.nix index 77a5eb5..9da66ac 100644 --- a/modules/home/direnv/default.nix +++ b/modules/home/direnv/default.nix @@ -1,4 +1,22 @@ -{ config, lib, pkgs, ... }: +{ +# 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; diff --git a/modules/home/i3/default.nix b/modules/home/i3/default.nix index 44b63a5..c682b9d 100644 --- a/modules/home/i3/default.nix +++ b/modules/home/i3/default.nix @@ -1,4 +1,22 @@ -{ config, lib, pkgs, ... }: +{ +# 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; diff --git a/modules/home/neovim/default.nix b/modules/home/neovim/default.nix index 2839c25..b76dc89 100644 --- a/modules/home/neovim/default.nix +++ b/modules/home/neovim/default.nix @@ -1,4 +1,22 @@ -{ config, lib, pkgs, ... }: +{ +# 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; diff --git a/modules/home/rofi/default.nix b/modules/home/rofi/default.nix index fe44565..6627686 100644 --- a/modules/home/rofi/default.nix +++ b/modules/home/rofi/default.nix @@ -1,4 +1,22 @@ -{ config, lib, pkgs, ... }: +{ +# 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; diff --git a/modules/home/topgrade/default.nix b/modules/home/topgrade/default.nix index aa8f11d..921f394 100644 --- a/modules/home/topgrade/default.nix +++ b/modules/home/topgrade/default.nix @@ -1,4 +1,22 @@ -{ config, lib, pkgs, ... }: +{ +# 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; diff --git a/modules/home/zsh/default.nix b/modules/home/zsh/default.nix index 5446b80..00de569 100644 --- a/modules/home/zsh/default.nix +++ b/modules/home/zsh/default.nix @@ -1,4 +1,22 @@ -{ config, lib, pkgs, ... }: +{ +# 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; diff --git a/modules/template.nix b/modules/template.nix index 5e07a9e..80b080e 100644 --- a/modules/template.nix +++ b/modules/template.nix @@ -18,6 +18,8 @@ systems, # An attribute map of your defined hosts. # All other arguments come from the module system. config, ... }: +with lib; + let cfg = config.modules.X; in { options.modules.X = { enable = mkOption { default = false; }; };