Git Product home page Git Product logo

nixos-flake's Introduction

nixos-flake's People

Contributors

bestlem avatar srid avatar tgunnoe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nixos-flake's Issues

Allow different users for a nixos or darwin configuration

Currently this usses myself as a global and only user.

Can machine setips also take a user name (possibly optional) my user name differs on different machines.

In some ways this is the generalisation of issue #19 for none homeManager configs.

I think this means mkLinuxSystem and mkMacosSystem have an optional parameter user that sets myself.

How to properly update on a linux only system

I've just started using this module based on the template with no changes other than my username and hostname.

Whenever I use nix run .#update I get the following warning:

warning: the flag '--update-input nix-darwin' does not match any input

Is there any configuration that needs to be set to avoid this?

Thanks

How to get support for more NixOS architectures

Presently, when using mkLinuxSystem, the system parameter is look like hardcoded to x86_64-linux.

mkLinuxSystem = mod: inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
# Arguments to pass to all modules.
specialArgs = specialArgsFor.nixos;
modules = [ mod ];
};

What should I do if I desire to create host configurations for other architectures like aarch64-linux?

I am try to use nixpkgs.lib.makeOverridable and then update system attribute, but I don't know if that's right because I am Nix noob.

I have noticed that the darwin generator has a system parameter, and I think it might be possible to add a similar parameter to mkLinuxSystem and set a default value to x86_64-linux to keep compatibility with existed configurations.

docs: How to use?

Thanks for this amazing project. I think it's exactly what I've been looking for ๐Ÿ’ช๐Ÿป

I was wondering if some documentation could be added explaining how to use it.
Similar to this explanation: https://github.com/srid/nixos-config#setup

And also an explanation of what would happen next, does a user have to run nix run every time?
How to remove afterwards?

Thanks!

Documentation how to use overlays

Thank you for these useful templates!

I'd like to use a nixpkgs overlay with this (use a different version of nix). Do you have an example how to use overlays with these templates? In my case I use mkARMMacosSystem.

I'd like to apply the following overlay to nixpkgs:

final: prev: {
  nix = final.nixVersions.nix_2_16;
}

Templates throw a `system.stateVersion is not set` warning

When I created a flake for mac and linux
nix flake check gives me

trace: warning: system.stateVersion is not set, defaulting to 23.05. Read why this matters on https://nixos.org/manual/nixos/stable/options.html#opt-system.stateVersion.

I note that in https://github.com/srid/nixos-config you do set it insystems/darwin.nix and systems/hetzner/ax101.nix - although first is to 4 and other is to a release number.

Show what was upgraded after activation

cf.

โฏ > nix store diff-closures /nix/var/nix/profiles/system-151-link /nix/var/nix/profiles/system-152-link
Agda: -1755.7 KiB
ChasingBottoms: -20.8 KiB
JuicyPixels: -97.2 KiB
aeson: +84.2 KiB
aeson-pretty: -8.6 KiB
attoparsec: +18.9 KiB
bifunctors: +33.1 KiB
blaze-html: +8.1 KiB
boring: โˆ… โ†’ 0.2.1
cmdargs: โˆ… โ†’ 0.10.22
darwin-system: 23.05.20230406.0e19daa+darwin4.87b9d09 โ†’ 23.05.20230411.3fb8eed+darwin4.87b9d09
digest: 0.0.1.6 โ†’ 0.0.1.7
doclayout: 0.4 โ†’ 0.4.0.1, +50.5 KiB
...

Is there a way to specify different nixpkgs for different hosts?

Currently, I am trying to track nixpkgs versions separately for different hosts. My old flake.nix had the following:

{
  inputs = {
    # To update nixpkgs (and thus NixOS), pick the nixos-20.09 rev from
    # https://status.nixos.org/
    # (Or, alternatively, nixos-unstable rev.)
    # 
    # 22.05 @21.11.2022
    nixpkgs.url = "github:nixos/nixpkgs/cf63ade6f74bbc9d2a017290f1b2e33e8fbfa70a";
    # 23.11 @07.05.2024
    nixpkgs2.url = "github:nixos/nixpkgs/27c13997bf450a01219899f5a83bd6ffbfc70d3c";
    nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
  };

  outputs = { self, nixpkgs, nixpkgs2, nixos-wsl }: {
    # choice will be done "automatically" based on hostname
    nixosConfigurations.myhost1 = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [ ./myhost1.nix ];
    };
    nixosConfigurations.myhost2 = nixpkgs2.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        nixos-wsl.nixosModules.default
        ./myhost2.nix
      ];
    };
  };
}

I'm trying to port this config to nixos-flake, to let me unify it with my home-manager configs. However, I noticed that nixos-flake seems to be hardcoded to use inputs.nixpkgs, and inputs are passed via flake-parts.lib.mkFlake { inherit inputs; }, so I don't see a clear way to use different nixpkgs between different nixosConfigurations inside nixos-flake. Do you have any suggestions how I could try doing this? I am ok to try modifying nixos-flake code, but I'd be grateful for suggestions how to try approaching that in such case; currently flake-parts is still quite confusing to me; and also you know nixos-flake better, so may have better ideas what approach could be better suited to it.

Fix home template test

+ nix run '.#homeConfigurations."john".activationPackage'
warning: creating lock file '/Users/srid/code/nixos-flake/examples/home/flake.lock'
warning: Git tree '/Users/srid/code/nixos-flake' is dirty
Starting Home Manager activation
Error: HOME is set to "/Users/srid/code/nixos-flake/examples/home/tmp/home" but we expect "/Users/john"

cf. nix-community/home-manager#4022

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.