Modularize with numtide/blueprint
This commit is contained in:
parent
d0b1495ede
commit
5335a08eb5
17 changed files with 135 additions and 170 deletions
37
flake.lock
generated
37
flake.lock
generated
|
|
@ -1,5 +1,26 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"blueprint": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1763308703,
|
||||||
|
"narHash": "sha256-O9Y+Wer8wOh+N+4kcCK5p/VLrXyX+ktk0/s3HdZvJzk=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "blueprint",
|
||||||
|
"rev": "5a9bba070f801d63e2af3c9ef00b86b212429f4f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "blueprint",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
|
@ -92,6 +113,7 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"blueprint": "blueprint",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"mysecrets": "mysecrets",
|
"mysecrets": "mysecrets",
|
||||||
"nix-vscode-extensions": "nix-vscode-extensions",
|
"nix-vscode-extensions": "nix-vscode-extensions",
|
||||||
|
|
@ -119,6 +141,21 @@
|
||||||
"repo": "sops-nix",
|
"repo": "sops-nix",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
|
||||||
42
flake.nix
42
flake.nix
|
|
@ -4,6 +4,11 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
|
blueprint = {
|
||||||
|
url = "github:numtide/blueprint";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
||||||
|
|
||||||
# Secrets management
|
# Secrets management
|
||||||
|
|
@ -28,41 +33,6 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, home-manager, ... }@inputs: let
|
outputs = inputs: inputs.blueprint { inherit inputs; };
|
||||||
inherit (self) outputs;
|
|
||||||
system = "x86_64-linux";
|
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
|
||||||
in {
|
|
||||||
|
|
||||||
# Custom packages and modifications, exported as overlays
|
|
||||||
overlays = import ./overlays {inherit inputs;};
|
|
||||||
|
|
||||||
nixosConfigurations = {
|
|
||||||
sesame = nixpkgs.lib.nixosSystem {
|
|
||||||
specialArgs = {inherit inputs;};
|
|
||||||
modules = [
|
|
||||||
./hosts/sesame/configuration.nix
|
|
||||||
# inputs.home-manager.nixosModules.default
|
|
||||||
];
|
|
||||||
};
|
|
||||||
gwiad = nixpkgs.lib.nixosSystem {
|
|
||||||
specialArgs = {inherit inputs outputs;};
|
|
||||||
modules = [
|
|
||||||
./hosts/gwiad/configuration.nix
|
|
||||||
# inputs.home-manager.nixosModules.default
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
homeConfigurations."julien" = home-manager.lib.homeManagerConfiguration {
|
|
||||||
inherit pkgs;
|
|
||||||
|
|
||||||
# Specify your home configuration modules here, for example,
|
|
||||||
# the path to your home.nix.
|
|
||||||
modules = [ ./homes/scalizer ];
|
|
||||||
|
|
||||||
# Optionally use extraSpecialArgs
|
|
||||||
# to pass through arguments to home.nix
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
{ ... }:
|
|
||||||
{
|
|
||||||
|
|
||||||
imports = [
|
|
||||||
./user-info.nix
|
|
||||||
./base.nix
|
|
||||||
./editor.nix
|
|
||||||
./vc.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{ config, pkgs, ... }:
|
|
||||||
{
|
|
||||||
|
|
||||||
programs.helix = {
|
|
||||||
enable = true;
|
|
||||||
defaultEditor = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
{ lib, ... }:
|
|
||||||
{
|
|
||||||
|
|
||||||
options.user.info = {
|
|
||||||
name = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
};
|
|
||||||
email = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config.user.info = {
|
|
||||||
name = lib.mkDefault "Julien Hémono";
|
|
||||||
email = lib.mkDefault "julien@hemono.fr";
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
{ config, pkgs, ... }:
|
|
||||||
{
|
|
||||||
|
|
||||||
programs.git = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
user = {
|
|
||||||
email = config.user.info.email;
|
|
||||||
name = config.user.info.name;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.jujutsu = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
user = {
|
|
||||||
email = config.user.info.email;
|
|
||||||
name = config.user.info.name;
|
|
||||||
};
|
|
||||||
ui.default-command = "log";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.gh = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,17 +1,15 @@
|
||||||
{ config, pkgs, ... }:
|
{ flake, config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
imports = [
|
imports = with flake.homeModules; [
|
||||||
../common
|
base
|
||||||
|
git
|
||||||
];
|
];
|
||||||
|
|
||||||
home.username = "julien";
|
|
||||||
home.homeDirectory = "/home/julien";
|
|
||||||
|
|
||||||
home.stateVersion = "25.05";
|
home.stateVersion = "25.05";
|
||||||
|
|
||||||
user.info.email = "julien@scalizer.fr";
|
user.email = "julien@scalizer.fr";
|
||||||
|
|
||||||
programs.uv.enable = true;
|
programs.uv.enable = true;
|
||||||
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
{ ... }:
|
|
||||||
{
|
|
||||||
|
|
||||||
imports = [
|
|
||||||
./nix.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,19 +1,13 @@
|
||||||
# Edit this configuration file to define what should be installed on
|
{ inputs, flake, pkgs, hostName, ... }:
|
||||||
# your system. Help is available in the configuration.nix(5) man page, on
|
|
||||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
|
||||||
|
|
||||||
{ config, lib, pkgs, inputs, outputs, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = with flake.nixosModules; [
|
||||||
[ # Include the results of the hardware scan.
|
./hardware-configuration.nix
|
||||||
./hardware-configuration.nix
|
base
|
||||||
../common
|
jhemono
|
||||||
./home.nix
|
# Services
|
||||||
# Services
|
./btrbk.nix
|
||||||
./btrbk.nix
|
./syncthing.nix
|
||||||
./syncthing.nix
|
];
|
||||||
];
|
|
||||||
|
|
||||||
# Boot configuration
|
# Boot configuration
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
|
@ -21,7 +15,7 @@
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
# Networking
|
# Networking
|
||||||
networking.hostName = "gwiad";
|
networking.hostName = hostName;
|
||||||
networking.networkmanager.enable = true;
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
# Set your time zone.
|
# Set your time zone.
|
||||||
|
|
@ -32,6 +26,9 @@
|
||||||
keyMap = "fr";
|
keyMap = "fr";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
users.users.jhemono.uid = 1000;
|
||||||
|
users.groups.jhemono.gid = 1000;
|
||||||
|
|
||||||
# Enable CUPS to print documents.
|
# Enable CUPS to print documents.
|
||||||
# services.printing.enable = true;
|
# services.printing.enable = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
# Edit this configuration file to define what should be installed on
|
|
||||||
# your system. Help is available in the configuration.nix(5) man page, on
|
|
||||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
|
||||||
|
|
||||||
{ config, lib, pkgs, inputs, outputs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
inputs.home-manager.nixosModules.home-manager
|
|
||||||
];
|
|
||||||
|
|
||||||
users.users.jhemono = {
|
|
||||||
isNormalUser = true;
|
|
||||||
uid = 1000;
|
|
||||||
extraGroups = [ "wheel" ]; # Enable 'sudo' for the user.
|
|
||||||
};
|
|
||||||
users.groups.jhemono.gid = 1000;
|
|
||||||
|
|
||||||
home-manager = {
|
|
||||||
useGlobalPkgs = true;
|
|
||||||
useUserPackages = true;
|
|
||||||
backupFileExtension = "bak";
|
|
||||||
users.jhemono = ../../homes/me;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
{ config, pkgs, ... }:
|
{ flake, config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
imports = [
|
imports = with flake.homeModules; [
|
||||||
../common
|
base
|
||||||
|
git
|
||||||
];
|
];
|
||||||
|
|
||||||
home.stateVersion = "25.05"; # Please read the comment before changing.
|
home.stateVersion = "25.05"; # Please read the comment before changing.
|
||||||
|
|
@ -2,13 +2,12 @@
|
||||||
# your system. Help is available in the configuration.nix(5) man page, on
|
# your system. Help is available in the configuration.nix(5) man page, on
|
||||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||||
|
|
||||||
{ config, lib, pkgs, ... }:
|
{ flake, config, hostName, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = with flake.nixosModules; [
|
||||||
[ # Include the results of the hardware scan.
|
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../common
|
base
|
||||||
# Supporting
|
# Supporting
|
||||||
./buckets.nix
|
./buckets.nix
|
||||||
./nginx.nix
|
./nginx.nix
|
||||||
|
|
@ -28,7 +27,7 @@
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
# Networking
|
# Networking
|
||||||
networking.hostName = "sesame";
|
networking.hostName = hostName;
|
||||||
networking.domain = "hemono.fr";
|
networking.domain = "hemono.fr";
|
||||||
|
|
||||||
# Set your time zone.
|
# Set your time zone.
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
{ config, pkgs, ... }:
|
|
||||||
{
|
{
|
||||||
|
|
||||||
programs.bash.enable = true;
|
programs.bash.enable = true;
|
||||||
|
|
@ -7,4 +6,9 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.helix = {
|
||||||
|
enable = true;
|
||||||
|
defaultEditor = true;
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
26
modules/home/git.nix
Normal file
26
modules/home/git.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
{ flake, ... }:
|
||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
|
||||||
|
imports = [ flake.homeModules.user ];
|
||||||
|
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
user = config.user;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.jujutsu = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
user = config.user;
|
||||||
|
ui.default-command = "log";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.gh = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
17
modules/home/user.nix
Normal file
17
modules/home/user.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
|
|
||||||
|
options.user = {
|
||||||
|
name = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "User full name";
|
||||||
|
default = "Julien Hémono";
|
||||||
|
};
|
||||||
|
email = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "User full name";
|
||||||
|
default = "julien@hemono.fr";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
{ config, pkgs, ... }:
|
|
||||||
{
|
{
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
|
|
@ -10,7 +9,6 @@
|
||||||
settings = {
|
settings = {
|
||||||
experimental-features = [ "nix-command" "flakes" ];
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
auto-optimise-store = true;
|
auto-optimise-store = true;
|
||||||
trusted-users = [ "jhemono" ];
|
|
||||||
};
|
};
|
||||||
channel.enable = false;
|
channel.enable = false;
|
||||||
};
|
};
|
||||||
18
modules/nixos/jhemono.nix
Normal file
18
modules/nixos/jhemono.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
{ inputs, config, lib, ... }:
|
||||||
|
let
|
||||||
|
username = "jhemono";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
|
||||||
|
users.users.${username} = {
|
||||||
|
description = "Julien Hémono";
|
||||||
|
isNormalUser = true;
|
||||||
|
createHome = true;
|
||||||
|
extraGroups = [ "wheel" ];
|
||||||
|
# openssh.authorizedKeys.keys = info.authorizedKeys;
|
||||||
|
initialPassword = "cheval";
|
||||||
|
};
|
||||||
|
|
||||||
|
nix.settings.trusted-users = [ username ];
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue