Skip to content

RegEM/flake-starter-config

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ultimate guide video repo

search for packages

https://search.nixos.org/packages

initializing flake

$ cd /etc/nixos
$ sudo nix flake init --template github:vimjoyer/flake-starter-config

rebuilding with flakes enabled

$ sudo nixos-rebuild switch --flake /etc/nixos/#default

generating home.nix

$ nix run home-manager/master -- init && \\
  sudo cp ~/.config/home-manager/home.nix /etc/nixos/

home-manager option

home-manager = {
  # also pass inputs to home-manager modules
  extraSpecialArgs = {inherit inputs;};
  users = {
    "username" = import ./home.nix;
  };
};

example module / main-user.nix

{ lib, config, pkgs, ... }:

let
  cfg = config.main-user;
in
{
  options.main-user = {
    enable 
      = lib.mkEnableOption "enable user module";

    userName = lib.mkOption {
      default = "mainuser";
      description = ''
        username
      '';
    };
  };

  config = lib.mkIf cfg.enable {
    users.users.${cfg.userName} = {
      isNormalUser = true;
      initialPassword = "12345";
      description = "main user";
      shell = pkgs.zsh;
    };
  };
}

example project structure

 flake.nix

 flake.lock

 modules/

   nixos/
    
     nvidia.nix

   home-manager/

     terminals/
      
       default.nix

       kitty.nix

       alacritty.nix

 hosts/

   default/

     configuration.nix

     hardware-configuration.nix

     home.nix

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Nix 100.0%