dirkkelly / flake-starter-config

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ultimate guide video repo

Sourced from the video https://www.youtube.com/watch?v=a67Sv4Mbxmc

search for packages

https://search.nixos.org/packages

initializing flake

cd /etc/nixos
sudo nix flake init --template github:dirkkelly/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 = {
    "dirkkelly" = 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 = ''
        dirkkelly
      '';
    };
  };

  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

License:The Unlicense


Languages

Language:Nix 100.0%