Comments (5)
Don't know the best way to get the home manager version (hardcoded to "23.05" here), maybe
lib.version
but that is from nixpkgs not home manager.
There is config.home.version.release
: https://github.com/nix-community/home-manager/blob/f8e6694edabe4aaa7a85aac47b43ea5d978b116d/modules/misc/version.nix#L53-L60
from nix.
Maybe something like
mkVersionedOpt = minimumVersion: opt:
if (lib.strings.versionAtLeast
(config.home.version.release or config.system.nixos.version)
minimumVersion)
then opt
else lib.options.mkSinkUndeclaredOptions { };
options.programs.tofi = ctp.mkVersionedOpt "24.05" {
catppuccin = ctp.mkCatppuccinOpt "tofi";
};
Tested it with https://github.com/Misterio77/nix-starter-configs and it builds.
Don't know the best way to get the home manager version (hardcoded to "23.05" here), maybe lib.version
but that is from nixpkgs not home manager.
https://github.com/vdbe/catppuccin-nix/tree/feat/versioned-options
from nix.
Forgot that internal doesn't show on search.
config.home.version.release or config.system.nixos.version
would work covers home manager and nixos.
from nix.
Was trying to add a warning, but don't think it is possible:
else lib.trivial.warn "warning" (lib.options.mkSinkUndeclaredOptions {});
andelse lib.options.mkSinkUndeclaredOptions (lib.trivial.warn "warning" {});
warn always.else lib.options.mkSinkUndeclaredOptions {default = lib.trivial.warn "warning" opt;};
never warns.
from nix.
I'm using nixos & home-manager 23.11 and am currently stuck in a
error: attribute 'enable' missing
at /nix/store/flqfgj6fnp3cqfy19041lw4j1lhds76n-home-manager/tofi.nix:9:26:
8| cfg = config.programs.tofi.catppuccin;
9| enable = cfg.enable && config.programs.tofi.enable;
| ^
10| in
I don't have any experience in the maintenance in multi-version targeting projects, but I'd use git branches for the version separations. This would avoid cluttering the source code and enable easy backporting if a component of home-manager/ nixos gets backported too (if there is the wish to do this, of course).
E.g. the nixvim project handles it like this.
from nix.
Related Issues (20)
- Why option `xdg.enable` is required? HOT 3
- package options HOT 1
- SDDM Themeing broke HOT 5
- Gradience Option for GTK? HOT 3
- Dependency Dashboard
- The option `qt.style' does not support nested options HOT 5
- Change GTK theme? HOT 4
- Global `catppuccin.enable` option may produce errors HOT 10
- "Update ports" action not detecting some changes? HOT 3
- Support integrating with plasma-manager for theming Plasma, Konsole, ...
- gnome crashes when using gtk.catppuccin.cursor.enable = true HOT 3
- Namespace our module options HOT 3
- Grub's boot-menu cuts off NixOS generation text HOT 1
- Feature request: custom palettes HOT 2
- SDDM theme not working HOT 4
- Will all the GTK related options be removed soon? HOT 2
- No themes are applying HOT 7
- Hyprcursor theme is set to "MyCursor" HOT 12
- Overriding catppuccin flavor for individual hm modules HOT 3
- Maintain our own derivations of ports where necessary
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nix.