Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
nix-starter-configs
Simple and documented config templates to help you get started with NixOS + home-manager + flakes. All the boilerplate you need!
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
I looked at some past threads / examples and saw people recommend flake-utils-plus, but after reading the examples I don't understand how I would get home-manager on Darwin or Ubuntu.
Inside of your common home.nix file, you can use functions like lib.mkIf and/or lib.mkMerge to conditionally import other files/modules or define options based on the system using attributes like pkgs.stdenv.isLinux; I do this pretty extensively in my own home-manager configurations, check out my kitty configuration for an example. I’m on my phone so I can’t really write any code without it taking a long time, also Reddit formatting sucks.
I believe my config does exactly what you need, you can take a look at how it works @ https://github.com/baitinq/nixos-config
Check this repo for reference https://github.com/MatthiasBenaets/nixos-config
I do what you describe in a very simple way. It's not really made for multiuser configurations as i mix home-manager config of services and packages with nixos, something i will review one day. It's a flake for macos/linux/nixos but there are certainly other more fancy repositories out there. https://github.com/sebastiant/dotfiles
Here is another one: https://github.com/mrkuz/nixos
Nix-starter-configs seems to be the perfect way to do this simply. Amazing comments teaching you how to take the template and make it all of what you want.
I created a nix starter for my team at work https://github.com/dlip/nixconfig-starter