mirror of
https://github.com/willemml/dotfiles.nix.git
synced 2025-04-12 19:27:17 +00:00
convert system configurations to flake-parts
This commit is contained in:
parent
142ada9298
commit
be200a87c2
17 changed files with 176 additions and 11 deletions
|
@ -3,6 +3,7 @@
|
||||||
./apps.nix
|
./apps.nix
|
||||||
./home-manager
|
./home-manager
|
||||||
./lib
|
./lib
|
||||||
|
./nixos
|
||||||
./overlays.nix
|
./overlays.nix
|
||||||
./packages.nix
|
./packages.nix
|
||||||
];
|
];
|
||||||
|
|
6
flake-parts/nixos/default.nix
Normal file
6
flake-parts/nixos/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./hosts.nix
|
||||||
|
./modules.nix
|
||||||
|
];
|
||||||
|
}
|
55
flake-parts/nixos/hosts.nix
Normal file
55
flake-parts/nixos/hosts.nix
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
{ self, inputs, ... }: {
|
||||||
|
flake = {
|
||||||
|
nixosModules.base = { config, ... }: {
|
||||||
|
imports = [
|
||||||
|
../../nixos/profiles/common.nix
|
||||||
|
../../nixos/profiles/linux-common.nix
|
||||||
|
inputs.home-manager.nixosModules.home-manager
|
||||||
|
self.nixosModules.default
|
||||||
|
self.nixosModules.home-manager-integration
|
||||||
|
self.nixosModules.nixpkgs-useFlakeNixpkgs
|
||||||
|
];
|
||||||
|
|
||||||
|
nixpkgs.overlays = builtins.attrValues self.overlays;
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
darwinModules.base = { config, ... }: {
|
||||||
|
imports = [
|
||||||
|
../../nixos/profiles/common.nix
|
||||||
|
inputs.home-manager.darwinModules.home-manager
|
||||||
|
self.nixosModules.custom-linkNixInputs
|
||||||
|
self.nixosModules.home-manager-integration
|
||||||
|
];
|
||||||
|
|
||||||
|
nixpkgs.overlays = builtins.attrValues self.overlays;
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
nixosConfigurations.zeusvm = inputs.nixpkgs.lib.nixosSystem {
|
||||||
|
system = "aarch64-linux";
|
||||||
|
modules = [
|
||||||
|
self.nixosModules.base
|
||||||
|
../../nixos/hosts/zeus.utmvm.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
nixosConfigurations.zeusasahi = inputs.nixpkgs.lib.nixosSystem {
|
||||||
|
system = "aarch64-linux";
|
||||||
|
modules = [
|
||||||
|
self.nixosModules.appleSilicon
|
||||||
|
self.nixosModules.base
|
||||||
|
../../nixos/hosts/zeus.asahi.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
darwinConfigurations.zeus = inputs.darwin.lib.darwinSystem {
|
||||||
|
system = "aarch64-darwin";
|
||||||
|
modules = [
|
||||||
|
self.darwinModules.base
|
||||||
|
../../nixos/hosts/zeus.darwin.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
40
flake-parts/nixos/modules.nix
Normal file
40
flake-parts/nixos/modules.nix
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
# Copyright (c) 2018 Terje Larsen
|
||||||
|
|
||||||
|
# This work is licensed under the terms of the MIT license.
|
||||||
|
# For a copy, see https://opensource.org/licenses/MIT.
|
||||||
|
|
||||||
|
# https://github.com/terlar/nix-config/blob/00c8a3622e8bc4cb522bbf335e6ede04ca07da40/flake-parts/lib/default.nix
|
||||||
|
|
||||||
|
{ self
|
||||||
|
, inputs
|
||||||
|
, ...
|
||||||
|
}: {
|
||||||
|
flake.nixosModules =
|
||||||
|
let
|
||||||
|
modules = self.lib.importDirToAttrs ../../nixos/modules;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
default = {
|
||||||
|
imports = builtins.attrValues modules;
|
||||||
|
};
|
||||||
|
|
||||||
|
appleSilicon = { config, ... }: {
|
||||||
|
imports = [ inputs.nixos-apple-silicon.nixosModules.apple-silicon-support ];
|
||||||
|
nixpkgs.overlays = [ inputs.nixos-apple-silicon.overlays.default ];
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgs-useFlakeNixpkgs = {
|
||||||
|
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
|
||||||
|
nix.registry.nixpkgs.flake = inputs.nixpkgs;
|
||||||
|
};
|
||||||
|
|
||||||
|
home-manager-integration = {
|
||||||
|
config.home-manager = {
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
backupFileExtension = "bak";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// modules;
|
||||||
|
}
|
29
flake.lock
generated
29
flake.lock
generated
|
@ -20,6 +20,27 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"emacs-overlay": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1679104561,
|
||||||
|
"narHash": "sha256-JVyv+GeyJr7Zlxjt54sjHo90KpUGSUiVs/6tUBUuvQc=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "emacs-overlay",
|
||||||
|
"rev": "65c5d30a355533e3f0b7b6f0417270744978134e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "emacs-overlay",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -56,11 +77,11 @@
|
||||||
},
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1678901627,
|
"lastModified": 1667395993,
|
||||||
"narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=",
|
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6",
|
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -269,8 +290,8 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"darwin": "darwin",
|
"darwin": "darwin",
|
||||||
|
"emacs-overlay": "emacs-overlay",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixos-apple-silicon": "nixos-apple-silicon",
|
"nixos-apple-silicon": "nixos-apple-silicon",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
|
|
|
@ -5,8 +5,9 @@
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
darwin.url = "github:lnl7/nix-darwin";
|
darwin.url = "github:lnl7/nix-darwin";
|
||||||
darwin.inputs.nixpkgs.follows = "nixpkgs";
|
darwin.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
emacs-overlay.url = "github:nix-community/emacs-overlay";
|
||||||
|
emacs-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
|
||||||
home-manager.url = "github:nix-community/home-manager";
|
home-manager.url = "github:nix-community/home-manager";
|
||||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
nixos-apple-silicon.url = "github:tpwrules/nixos-apple-silicon";
|
nixos-apple-silicon.url = "github:tpwrules/nixos-apple-silicon";
|
||||||
|
|
|
@ -74,6 +74,7 @@ in
|
||||||
bash
|
bash
|
||||||
bat
|
bat
|
||||||
black
|
black
|
||||||
|
cachix
|
||||||
clang-tools
|
clang-tools
|
||||||
cmake
|
cmake
|
||||||
comma
|
comma
|
||||||
|
|
18
home-manager/modules/services/emacs.nix
Normal file
18
home-manager/modules/services/emacs.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
{
|
||||||
|
launchd.agents.emacs = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
ProgramArguments = [
|
||||||
|
"${config.programs.emacs.finalPackage}/bin/emacs"
|
||||||
|
"--fg-daemon"
|
||||||
|
];
|
||||||
|
KeepAlive = true;
|
||||||
|
UserName = "${config.home.username}";
|
||||||
|
ProcessType = "Adaptive";
|
||||||
|
StandardOutPath = "${config.home.homeDirectory}/Library/Logs/emacs-stdout.log";
|
||||||
|
StandardErrorPath = "${config.home.homeDirectory}/Library/Logs/emacs-stderr.log";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
18
home-manager/modules/services/offlineimap.nix
Normal file
18
home-manager/modules/services/offlineimap.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
{
|
||||||
|
launchd.agents.emacs = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
ProgramArguments = [
|
||||||
|
"${config.programs.emacs.finalPackage}/bin/emacs"
|
||||||
|
"--fg-daemon"
|
||||||
|
];
|
||||||
|
KeepAlive = true;
|
||||||
|
UserName = "${config.home.username}";
|
||||||
|
ProcessType = "Adaptive";
|
||||||
|
StandardOutPath = "${config.home.homeDirectory}/Library/Logs/emacs-stdout.log";
|
||||||
|
StandardErrorPath = "${config.home.homeDirectory}/Library/Logs/emacs-stderr.log";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [ ./nixos.common.nix ./nixos.gnome.nix ];
|
imports = [ ../profiles/linux-common.nix ../profiles/gnome.nix ];
|
||||||
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = false;
|
boot.loader.efi.canTouchEfiVariables = false;
|
|
@ -1,7 +1,7 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [ ./common.nix ];
|
imports = [ ../profiles/common.nix ];
|
||||||
|
|
||||||
environment.etc."nix/user-sandbox.sb".text = ''
|
environment.etc."nix/user-sandbox.sb".text = ''
|
||||||
(version 1)
|
(version 1)
|
|
@ -1,8 +1,12 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [ ./nixos.common.nix ./nixos.gnome.nix ];
|
imports = [
|
||||||
|
../profiles/desktop.nix
|
||||||
|
../profiles/gnome.nix
|
||||||
|
../profiles/linux-common.nix
|
||||||
|
];
|
||||||
|
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_pci" "usbhid" "usb_storage" "sr_mod" ];
|
boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_pci" "usbhid" "usb_storage" "sr_mod" ];
|
||||||
|
@ -13,7 +17,7 @@
|
||||||
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [ mesa ];
|
environment.systemPackages = with pkgs; [ mesa ];
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
device = "/dev/disk/by-label/nixos";
|
device = "/dev/disk/by-label/nixos";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
|
@ -1,7 +1,7 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [ ./nixos.desktop.nix ];
|
imports = [ ./desktop.nix ];
|
||||||
|
|
||||||
environment.gnome.excludePackages = (with pkgs; [
|
environment.gnome.excludePackages = (with pkgs; [
|
||||||
gnome-photos
|
gnome-photos
|
Loading…
Add table
Reference in a new issue