forked from auxolotl/templates
use standard module system over specialArgs
This commit is contained in:
parent
6835947061
commit
f295553095
|
@ -44,24 +44,28 @@
|
|||
|
||||
# the specialArgs are used to pass the inputs to the system configuration and home-manager configuration
|
||||
specialArgs = {
|
||||
inherit inputs username hostname;
|
||||
inherit inputs;
|
||||
};
|
||||
in
|
||||
{
|
||||
# it is important that you use darwin.lib.darwinSystem as this is the builder that allow
|
||||
# for the configuration of the darwin system
|
||||
darwinConfigurations.${hostname} = darwin.lib.darwinSystem {
|
||||
inherit system;
|
||||
|
||||
# The specialArgs are used to pass the inputs to the system configuration
|
||||
inherit specialArgs;
|
||||
|
||||
modules = [
|
||||
./core.nix
|
||||
./homebrew.nix
|
||||
./users.nix
|
||||
./system.nix
|
||||
|
||||
# The home-manager module is used to configure home-manager
|
||||
# to read more about this please see ../home-manager
|
||||
home-manager.darwinModules.home-manager
|
||||
(
|
||||
{ config, ... }:
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
|
@ -69,9 +73,23 @@
|
|||
# extraSpecialArgs is used to pass the inputs to the home-manager configuration
|
||||
home-manager.extraSpecialArgs = specialArgs;
|
||||
|
||||
# Here we have assume that the use is called "axel" but you can change that to your needs
|
||||
home-manager.users.${username} = import ./home.nix;
|
||||
# Here we can create our user
|
||||
uses.users.${username} = {
|
||||
home = "/Users/${username}";
|
||||
};
|
||||
|
||||
# And a home-manager configuration for them
|
||||
home-manager.users.${username} = {
|
||||
imports = [ ./home.nix ];
|
||||
|
||||
home.username = username;
|
||||
};
|
||||
|
||||
# Here we set our (networking) host name and computer name. They should usually be the same
|
||||
networking.hostName = hostname;
|
||||
networking.computerName = config.networking.hostName;
|
||||
}
|
||||
)
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
{ username, ... }:
|
||||
{ config, ... }:
|
||||
{
|
||||
# Home Manager needs a bit of information about you and the
|
||||
# paths it should manage.
|
||||
home = {
|
||||
# remember we set this in our flake.nix file
|
||||
username = username;
|
||||
homeDirectory = "/Users/${username}";
|
||||
homeDirectory = "/Users/${config.home.username}";
|
||||
|
||||
# This value determines the Home Manager release that your
|
||||
# configuration is compatible with. This helps avoid breakage
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
config = {
|
||||
environment = {
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
# see <https://daiderd.com/nix-darwin/manual/index.html#sec-options> for more options
|
||||
{
|
||||
system = {
|
||||
# remember to set the hostname in the kernel command line
|
||||
defaults.smb.NetBIOSName = config.networking.hostName;
|
||||
|
||||
# Add ability to used TouchID for sudo authentication
|
||||
security.pam.enableSudoTouchIdAuth = true;
|
||||
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
{ username, hostname, ... }:
|
||||
{
|
||||
# remember to set the hostname in the kernel command line
|
||||
networking.hostName = hostname;
|
||||
networking.computerName = hostname;
|
||||
system.defaults.smb.NetBIOSName = hostname;
|
||||
|
||||
users.users."${username}".home = "/Users/${username}";
|
||||
}
|
|
@ -16,7 +16,7 @@
|
|||
};
|
||||
|
||||
outputs =
|
||||
{ nixpkgs, home-manager, ... }:
|
||||
inputs@{ nixpkgs, home-manager, ... }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
@ -28,13 +28,17 @@
|
|||
|
||||
# Specify your home configuration modules here, for example,
|
||||
# the path to your home.nix.
|
||||
modules = [ ./home.nix ];
|
||||
modules = [
|
||||
./home.nix
|
||||
|
||||
{ home.username = username; }
|
||||
];
|
||||
|
||||
extraSpecialArgs = {
|
||||
inherit username pkgs; # We inherit pkgs
|
||||
};
|
||||
# Optionally use extraSpecialArgs
|
||||
# to pass through arguments to home.nix
|
||||
extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,15 +1,9 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
# Home Manager needs a bit of information about you and the paths it should
|
||||
# manage.
|
||||
home = {
|
||||
inherit username;
|
||||
homeDirectory = "/home/${username}";
|
||||
homeDirectory = "/home/${config.home.username}";
|
||||
|
||||
# This value determines the Home Manager release that your configuration is
|
||||
# compatible with. This helps avoid breakage when a new Home Manager release
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
username,
|
||||
hostName,
|
||||
...
|
||||
}:
|
||||
|
||||
|
@ -17,7 +15,6 @@
|
|||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
networking.hostName = hostName; # Define your hostname.
|
||||
# Pick only one of the below networking options.
|
||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
||||
|
@ -59,7 +56,7 @@
|
|||
# services.xserver.libinput.enable = true;
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
users.users.${username} = {
|
||||
users.users.axol = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
|
||||
packages = with pkgs; [ firefox ];
|
||||
|
|
|
@ -4,17 +4,20 @@
|
|||
inputs.nixpkgs.url = "github:auxolotl/nixpkgs/nixpkgs-unstable";
|
||||
|
||||
outputs =
|
||||
{ nixpkgs, ... }:
|
||||
inputs@{ nixpkgs, ... }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
hostName = builtins.abort "You need to fill in your hostName"; # Set this variable equal to your hostName
|
||||
username = builtins.abort "You need to fill in your username"; # Set this variable equal to your username
|
||||
in
|
||||
{
|
||||
nixosConfigurations.${hostName} = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [ ./configuration.nix ];
|
||||
modules = [
|
||||
./configuration.nix
|
||||
|
||||
{ networking.hostName = hostName; }
|
||||
];
|
||||
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue