Compare commits

...

10 commits

27 changed files with 190 additions and 137 deletions

View file

@ -1,4 +1,4 @@
_: { {
imports = [./hardware-configuration.nix]; imports = [./hardware-configuration.nix];
networking.hostName = "marleycentre"; networking.hostName = "marleycentre";

View file

@ -1,4 +1,4 @@
_: { {
imports = [./hardware-configuration.nix]; imports = [./hardware-configuration.nix];
networking.hostName = "marleynet"; networking.hostName = "marleynet";

View file

@ -1,4 +1,4 @@
_: { {
services.autorandr = { services.autorandr = {
enable = true; enable = true;

View file

@ -1,4 +1,4 @@
_: { {
systemd = { systemd = {
mounts = [ mounts = [
{ {

View file

@ -2,6 +2,7 @@ modules/${class}/default.nix # imported by easy-hosts.perClass.modules
imports = [ imports = [
../base # common across all systems ../base # common across all systems
./base # common across all ${class} systems ./base # common across all ${class} systems
./shell # WM/DE ./shell # WM/DE
./programs ./programs
@ -12,9 +13,25 @@ modules/${class}/default.nix # imported by easy-hosts.perClass.modules
modules/home/default.nix modules/base/default.nix
imports = [ imports = [
../options # custom options used for deciding other config
{...} # modules w/i base
./home.nix # home-manager setup; imports modules/home
];
modules/home/default.nix # HOME MANAGER OPTIONS ONLY
imports = [
../options
{...}
./shell # WM/DE ./shell # WM/DE
./programs ./programs
# default.nix - turns on/off depending on profile # default.nix - turns on/off depending on profile

View file

@ -2,8 +2,8 @@
imports = [ imports = [
../options ../options
# ./nix.nix
../home ./home.nix
]; ];
} }

22
modules/base/home.nix Normal file
View file

@ -0,0 +1,22 @@
let
my = {
name = "marley";
fullName = "Marley Rae";
username = "punkfairie";
email = "marley@punkfairie.net";
};
in {
marleyos.my = my;
home-manager = {
useUserPackages = true;
useGlobalPackages = true;
backupFileExtension = "bak";
users."${my.name}" = {
home.username = my.name;
};
sharedModules = [../home];
};
}

62
modules/base/nix.nix Normal file
View file

@ -0,0 +1,62 @@
{
pkgs,
inputs,
...
}: {
nix = {
package = pkgs.lix;
# Pin system <nixpkgs> to flake nixpkgs version.
# i.e. for use in pkgs = import <nixpkgs> {}.
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
# Pin flake registry nixpkgs to flake nixpkgs version.
# i.e. for use in nix search nixpkgs.
registry = {
nixpkgs.flake = inputs.nixpkgs;
};
settings = {
experimental-features = ["nix-command" "flakes"];
trusted-users = [
"root"
# @wheel/@admin are added in OS specific modules.
];
# Set up caches.
extra-substituters = [
"https://marleyos.cachix.org"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"marleyos.cachix.org-1:q2kEtqvS5CoQ8BmKlWOfOnN+fi4gUoSuL6HRKy37eCA="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
# Disable that annoying "git tree is dirty" warning.
warn-dirty = false;
auto-optimise-store = true;
use-xdg-base-directories = true;
};
# Garbage collection.
gc.automatic = true;
# More useful repl.
environment.systemPackages = let
nrepl =
pkgs.writeShellScriptBin "nrepl"
# sh
''
nix repl "${toString ./.}/repl.nix" "$@"
'';
in [
nrepl
];
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./home.nix
./nix.nix
];
}

View file

@ -0,0 +1,7 @@
{config, ...}: let
inherit (config.marleyos.my) name;
in {
home-manager.users."${name}" = {
home.homeDirectory = "/Users/${name}";
};
}

View file

@ -0,0 +1,9 @@
{
nix = {
settings = {
trusted-users = [
"@darwin"
];
};
};
}

View file

@ -1,5 +1,6 @@
{ {
imports = [ imports = [
../base ../base
./base
]; ];
} }

8
modules/home/default.nix Normal file
View file

@ -0,0 +1,8 @@
{
imports = [
../options
./option-inheritance.nix
./home-manager.nix
];
}

View file

@ -0,0 +1,8 @@
{
programs.home-manager.enable = true;
home.language.base = "en_US.UTF-8";
# Autostart wanted systemd services on Linux.
systemd.user.startServices = true;
}

View file

@ -0,0 +1,17 @@
{osConfig, ...}: let
cfg = osConfig.marleyos;
in {
marleyos = {
profiles = {
inherit (cfg.profiles) desktop server;
hardware = {
inherit (cfg.profiles.hardware) nvidia;
};
};
my = {
inherit (cfg.my) name fullName username email;
};
};
}

View file

@ -2,6 +2,10 @@
imports = [ imports = [
./boot.nix ./boot.nix
./drivers.nix ./drivers.nix
./home.nix
./i18n.nix ./i18n.nix
./networking.nix
./nix.nix
./users.nix
]; ];
} }

View file

@ -0,0 +1,7 @@
{config, ...}: let
inherit (config.marleyos.my) name;
in {
home-manager.users."${name}" = {
home.homeDirectory = "/home/${name}";
};
}

View file

@ -11,6 +11,6 @@
allowedTCPPorts = [80 443]; allowedTCPPorts = [80 443];
}; };
wireless.enable = lib.mkIf config.marleyos.isServer false; wireless.enable = lib.mkIf config.marleyos.profiles.server false;
}; };
} }

View file

@ -0,0 +1,9 @@
{
nix = {
settings = {
trusted-users = [
"@wheel"
];
};
};
}

View file

@ -34,11 +34,9 @@ in {
++ (lib.optional config.networking.networkmanager.enable "networkmanager") ++ (lib.optional config.networking.networkmanager.enable "networkmanager")
++ (lib.optional config.virtualisation.docker.enable "docker"); ++ (lib.optional config.virtualisation.docker.enable "docker");
hashedPassword = hashedPassword =
if config.marleyos.isServer if config.marleyos.profiles.server
then serverPass then serverPass
else desktopPass; else desktopPass;
}; };
}; };
home-manager.backupFileExtension = "bak";
} }

View file

@ -1,5 +1,7 @@
{ {
imports = [ imports = [
../base ../base
./base
]; ];
} }

View file

@ -1,5 +1,6 @@
{ {
imports = [ imports = [
./my.nix
./profiles.nix ./profiles.nix
]; ];
} }

View file

@ -6,7 +6,7 @@
options.marleyos.my = rec { options.marleyos.my = rec {
name = lib.mkOption { name = lib.mkOption {
type = with lib.types; str; type = with lib.types; str;
default = config.snowfallorg.user.name or "marley"; default = "marley";
description = "Your username, for use as your login name."; description = "Your username, for use as your login name.";
}; };

View file

@ -1,9 +0,0 @@
{
pkgs,
...
}:
{
config.nix = {
package = pkgs.lix;
};
}

View file

@ -1,25 +0,0 @@
{
lib,
system,
...
}: let
inherit (lib.snowfall.system) is-linux;
in {
# Anything in this folder should not include an enable/disable option. This is
# the only folder that is always applied.
config = {
marleyos.my = {
name = "marley";
username = "punkfairie";
fullName = "Marley Rae";
email = "marley@punkfairie.net";
};
home.language.base = "en_US.UTF-8";
programs.home-manager.enable = true;
# Autostart wanted systemd services.
systemd.user.startServices = lib.mkIf (is-linux system) true;
};
}

View file

@ -1,77 +0,0 @@
{
pkgs,
inputs,
config,
lib,
...
}: {
config = {
nix = {
package = lib.mkForce pkgs.lix;
# Pin system <nixpkgs> to flake nixpkgs version.
# i.e. for use in pkgs = import <nixpkgs> {}.
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
# Pin flake registry nixpkgs to flake nixpkgs version.
# i.e. for use in nix search nixpkgs.
registry = {
nixpkgs.flake = inputs.nixpkgs;
};
settings = {
trusted-users = [
"root"
"@wheel"
];
# Enable flakes.
experimental-features = [
"nix-command"
"flakes"
];
# Set up caches.
extra-substituters = [
"https://marleyos.cachix.org"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"marleyos.cachix.org-1:q2kEtqvS5CoQ8BmKlWOfOnN+fi4gUoSuL6HRKy37eCA="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
# Disable that annoying "git tree is dirty" warning.
warn-dirty = false;
auto-optimise-store = true;
};
# Garbage collection.
gc.automatic = true;
};
nixpkgs.config.import = "${config.xdg.configHome}/nixpkgs/config.nix";
xdg.configFile."nixpkgs/config.nix".text =
# nix
''
{
allowUnfree = true;
}
'';
home.packages = let
nrepl =
pkgs.writeShellScriptBin "nrepl"
# sh
''
nix repl "${toString ./.}/repl.nix" "$@"
'';
in [
nrepl
];
};
}

View file

@ -1,14 +0,0 @@
{pkgs, ...}: {
nix = {
package = pkgs.lix;
settings = {
experimental-features = ["nix-command" "flakes"];
trusted-users = [
"root"
"@wheel"
];
};
};
}