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": {
|
||||
"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": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
|
@ -92,6 +113,7 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"blueprint": "blueprint",
|
||||
"home-manager": "home-manager",
|
||||
"mysecrets": "mysecrets",
|
||||
"nix-vscode-extensions": "nix-vscode-extensions",
|
||||
|
|
@ -119,6 +141,21 @@
|
|||
"repo": "sops-nix",
|
||||
"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",
|
||||
|
|
|
|||
42
flake.nix
42
flake.nix
|
|
@ -4,6 +4,11 @@
|
|||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
|
||||
blueprint = {
|
||||
url = "github:numtide/blueprint";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
||||
|
||||
# Secrets management
|
||||
|
|
@ -28,41 +33,6 @@
|
|||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, home-manager, ... }@inputs: let
|
||||
inherit (self) outputs;
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
|
||||
# Custom packages and modifications, exported as overlays
|
||||
overlays = import ./overlays {inherit inputs;};
|
||||
outputs = inputs: inputs.blueprint { 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 = [
|
||||
../common
|
||||
imports = with flake.homeModules; [
|
||||
base
|
||||
git
|
||||
];
|
||||
|
||||
home.username = "julien";
|
||||
home.homeDirectory = "/home/julien";
|
||||
|
||||
home.stateVersion = "25.05";
|
||||
|
||||
user.info.email = "julien@scalizer.fr";
|
||||
user.email = "julien@scalizer.fr";
|
||||
|
||||
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
|
||||
# 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, ... }:
|
||||
|
||||
{ inputs, flake, pkgs, hostName, ... }:
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
../common
|
||||
./home.nix
|
||||
# Services
|
||||
./btrbk.nix
|
||||
./syncthing.nix
|
||||
];
|
||||
imports = with flake.nixosModules; [
|
||||
./hardware-configuration.nix
|
||||
base
|
||||
jhemono
|
||||
# Services
|
||||
./btrbk.nix
|
||||
./syncthing.nix
|
||||
];
|
||||
|
||||
# Boot configuration
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
|
|
@ -21,7 +15,7 @@
|
|||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
# Networking
|
||||
networking.hostName = "gwiad";
|
||||
networking.hostName = hostName;
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# Set your time zone.
|
||||
|
|
@ -32,6 +26,9 @@
|
|||
keyMap = "fr";
|
||||
};
|
||||
|
||||
users.users.jhemono.uid = 1000;
|
||||
users.groups.jhemono.gid = 1000;
|
||||
|
||||
# Enable CUPS to print documents.
|
||||
# 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 = [
|
||||
../common
|
||||
imports = with flake.homeModules; [
|
||||
base
|
||||
git
|
||||
];
|
||||
|
||||
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
|
||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ flake, config, hostName, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
imports = with flake.nixosModules; [
|
||||
./hardware-configuration.nix
|
||||
../common
|
||||
base
|
||||
# Supporting
|
||||
./buckets.nix
|
||||
./nginx.nix
|
||||
|
|
@ -28,7 +27,7 @@
|
|||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
# Networking
|
||||
networking.hostName = "sesame";
|
||||
networking.hostName = hostName;
|
||||
networking.domain = "hemono.fr";
|
||||
|
||||
# Set your time zone.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
|
||||
programs.bash.enable = true;
|
||||
|
|
@ -7,4 +6,9 @@
|
|||
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 = {
|
||||
|
|
@ -10,7 +9,6 @@
|
|||
settings = {
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
auto-optimise-store = true;
|
||||
trusted-users = [ "jhemono" ];
|
||||
};
|
||||
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