3d703f40df
Flake lock file updates: • Updated input 'home-manager': 'github:nix-community/home-manager/05e6ba83eb3585ce0aff7b41e4bd0e317d05ad4a?narHash=sha256-TnZETiQPXbyT5mdCHMOyrJnx2%2BBwroMBRrguciz1vEo%3D' (2024-05-26) → 'github:nix-community/home-manager/0eb314b4f0ba337e88123e0b1e57ef58346aafd9?narHash=sha256-HC5vJ3oYsjwsCaSbkIPv80e4ebJpNvFKQTBOGlHvjLs%3D' (2024-05-30) • Updated input 'lix': '5986a720d4
.tar.gz?narHash=sha256-VXsSaj3athaUjgbX9bovTNhSOgevU%2B8qWx9pgaQePdE%3D' (2024-05-26) → '3df013597d
.tar.gz?narHash=sha256-3sOBY0cNLgIFNk0YhBw%2Bkz57JLVphHTSypAKnkYz01g%3D' (2024-05-30) • Updated input 'lix-module': '18fa4a89e2
.tar.gz?narHash=sha256-fzY708SyfHwLOFrg5ZU0fXW9mNdvRvqz64jg97vvpJM%3D' (2024-05-23) → 'b4b38e6b5f
.tar.gz?narHash=sha256-joKTxvywYlKspGGKOIXho6oRbggOPyayEqAyuZCavO0%3D' (2024-05-30) • Removed input 'neovim-flake' • Removed input 'neovim-src' • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/2e7d6c568063c83355fe066b8a8917ee758de1b8?narHash=sha256-fe6Z33pbfqu4TI5ijmcaNc5vRBs633tyxJ12HTghy3w%3D' (2024-05-26) → 'github:NixOS/nixos-hardware/8251761f93d6f5b91cee45ac09edb6e382641009?narHash=sha256-uuEkErFVsFdg2K0cKbNQ9JlFSAm/xYqPr4rbPLI91Y8%3D' (2024-05-29) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/bfb7a882678e518398ce9a31a881538679f6f092?narHash=sha256-4zSIhSRRIoEBwjbPm3YiGtbd8HDWzFxJjw5DYSDy1n8%3D' (2024-05-24) → 'github:NixOS/nixpkgs/ad57eef4ef0659193044870c731987a6df5cf56b?narHash=sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs%3D' (2024-05-29) • Updated input 'nixvim': 'github:nix-community/nixvim/8212bf1cd2d2dfe6ba521dd8c65a13b67e562d1a?narHash=sha256-Zu0fn7bC%2BM/LwOOkR1RmeoOuCIbvvFwuqTldVBVe4WY%3D' (2024-05-26) → 'github:nix-community/nixvim/6ff3493c9bc85063ae829f0c25c21be3bde5c5b3?narHash=sha256-cKEGHGLaZoiNroMd34RrDgVDB7xgfff7HBShMz7cEy8%3D' (2024-05-30) • Added input 'nixvim/git-hooks': 'github:cachix/git-hooks.nix/0e8fcc54b842ad8428c9e705cb5994eaf05c26a0?narHash=sha256-xrsYFST8ij4QWaV6HEokCUNIZLjjLP1bYC60K8XiBVA%3D' (2024-05-20) • Added input 'nixvim/git-hooks/flake-compat': 'github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33?narHash=sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U%3D' (2023-10-04) • Added input 'nixvim/git-hooks/gitignore': 'github:hercules-ci/gitignore.nix/637db329424fd7e46cf4185293b9cc8c88c95394?narHash=sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs%3D' (2024-02-28) • Added input 'nixvim/git-hooks/gitignore/nixpkgs': follows 'nixvim/git-hooks/nixpkgs' • Added input 'nixvim/git-hooks/nixpkgs': follows 'nixvim/nixpkgs' • Added input 'nixvim/git-hooks/nixpkgs-stable': follows 'nixvim/nixpkgs' • Removed input 'nixvim/pre-commit-hooks' • Updated input 'stylix': 'github:jalil-salame/stylix/e5a4701b7d96c4909105a4c2366e4af3f188f802?narHash=sha256-u8enWMWhynbYlEFuVtTghwk1%2BLu8iT4tBoVWZxWCe/g%3D' (2024-05-24) → 'github:jalil-salame/stylix/036128f2517b1ff7d33d04773f48ea98d680128f?narHash=sha256-5ZHVsIg5akOIWImypmQMX/fXZZf3/7tzqJICLteFGZc%3D' (2024-05-27)
272 lines
7.5 KiB
Nix
272 lines
7.5 KiB
Nix
# This flake was initially generated by fh, the CLI for FlakeHub (version 0.1.9)
|
|
{
|
|
# A helpful description of your flake
|
|
description = "My NixOS configuration";
|
|
# Flake inputs
|
|
inputs = {
|
|
nixpkgs.url = "nixpkgs/nixos-unstable";
|
|
# Software
|
|
jpassmenu = {
|
|
url = "github:jalil-salame/jpassmenu";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
audiomenu = {
|
|
url = "github:jalil-salame/audiomenu";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
# Lix
|
|
lix = {
|
|
url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz";
|
|
flake = false;
|
|
};
|
|
lix-module = {
|
|
url = "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz";
|
|
inputs = {
|
|
lix.follows = "lix";
|
|
nixpkgs.follows = "nixpkgs";
|
|
flake-utils.follows = "flake-utils";
|
|
};
|
|
};
|
|
# Modules
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
|
stylix = {
|
|
url = "github:jalil-salame/stylix/enable-option";
|
|
inputs = {
|
|
nixpkgs.follows = "nixpkgs";
|
|
home-manager.follows = "home-manager";
|
|
};
|
|
};
|
|
nixvim = {
|
|
url = "github:nix-community/nixvim";
|
|
inputs = {
|
|
nixpkgs.follows = "nixpkgs";
|
|
devshell.follows = "devshell";
|
|
nix-darwin.follows = ""; # disable MacOS stuff
|
|
home-manager.follows = "home-manager";
|
|
flake-compat.follows = "stylix/flake-compat";
|
|
};
|
|
};
|
|
# For deduplication
|
|
systems.url = "github:nix-systems/default";
|
|
flake-utils = {
|
|
url = "github:numtide/flake-utils";
|
|
inputs.systems.follows = "systems";
|
|
};
|
|
devshell = {
|
|
url = "github:numtide/devshell";
|
|
inputs = {
|
|
flake-utils.follows = "flake-utils";
|
|
nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
};
|
|
|
|
# Flake outputs that other flakes can use
|
|
outputs = {
|
|
self,
|
|
nixpkgs,
|
|
stylix,
|
|
home-manager,
|
|
nixos-hardware,
|
|
jpassmenu,
|
|
audiomenu,
|
|
nixvim,
|
|
# neovim-flake,
|
|
# neovim-src,
|
|
lix,
|
|
lix-module,
|
|
...
|
|
}: let
|
|
inherit (nixpkgs) lib;
|
|
# Helpers for producing system-specific outputs
|
|
supportedSystems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
];
|
|
forEachSupportedSystem = f:
|
|
nixpkgs.lib.genAttrs supportedSystems (
|
|
system:
|
|
f {
|
|
inherit system;
|
|
pkgs = import nixpkgs {inherit system;};
|
|
}
|
|
);
|
|
overlays = builtins.attrValues self.overlays;
|
|
in {
|
|
checks = forEachSupportedSystem (
|
|
{
|
|
pkgs,
|
|
system,
|
|
}: let
|
|
src = builtins.path {
|
|
path = ./.;
|
|
name = "configuration.nix";
|
|
};
|
|
in {
|
|
nvim = nixvim.lib.${system}.check.mkTestDerivationFromNixvimModule {
|
|
pkgs = import nixpkgs {inherit system overlays;};
|
|
module = ./nvim/nixvim.nix;
|
|
};
|
|
formatting = pkgs.stdenvNoCC.mkDerivation {
|
|
name = "nix-formatting-check";
|
|
dontUnpack = true;
|
|
dontBuild = true;
|
|
doCheck = true;
|
|
checkPhase = "${pkgs.lib.getExe self.formatter.${system}} --check --quiet ${src}";
|
|
installPhase = "mkdir $out";
|
|
};
|
|
typos = let
|
|
typos = pkgs.lib.getExe pkgs.typos;
|
|
in
|
|
pkgs.stdenvNoCC.mkDerivation {
|
|
name = "typos-check";
|
|
dontUnpack = true;
|
|
dontBuild = true;
|
|
doCheck = true;
|
|
checkPhase = "${typos} --color=always ${src}";
|
|
installPhase = "mkdir $out";
|
|
};
|
|
}
|
|
);
|
|
|
|
packages = forEachSupportedSystem (
|
|
{
|
|
pkgs,
|
|
system,
|
|
}: {
|
|
inherit
|
|
(import ./docs {inherit pkgs lib;})
|
|
docs
|
|
nixos-markdown
|
|
nvim-markdown
|
|
home-markdown
|
|
;
|
|
# Nvim standalone module
|
|
nvim = nixvim.legacyPackages.${system}.makeNixvimWithModule {
|
|
pkgs = import nixpkgs {inherit system overlays;};
|
|
module = ./nvim/nixvim.nix;
|
|
};
|
|
}
|
|
);
|
|
|
|
# Provide necessary overlays
|
|
overlays = {
|
|
nixvim = nixvim.overlays.default;
|
|
jpassmenu = jpassmenu.overlays.default;
|
|
audiomenu = audiomenu.overlays.default;
|
|
# FIXME: remove once merged in nixpkgs
|
|
# neovim-nightly = final: prev: {
|
|
# neovim = final.callPackage (neovim-flake + "/flake/packages/neovim.nix") {inherit neovim-src;};
|
|
# };
|
|
};
|
|
|
|
# Nix files formatter (run `nix fmt`)
|
|
formatter = forEachSupportedSystem ({pkgs, ...}: pkgs.alejandra);
|
|
|
|
# Example vm configuration
|
|
nixosConfigurations.vm = let
|
|
system = "x86_64-linux";
|
|
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) ["steam-original"];
|
|
pkgs = import nixpkgs {inherit system overlays config;};
|
|
in
|
|
lib.nixosSystem {
|
|
inherit system pkgs;
|
|
modules = [
|
|
self.nixosModules.vm # import vm module
|
|
{
|
|
time.timeZone = "Europe/Berlin";
|
|
i18n.defaultLocale = "en_US.UTF-8";
|
|
users.users.jdoe = {
|
|
password = "example";
|
|
isNormalUser = true;
|
|
extraGroups = [
|
|
"wheel"
|
|
"video"
|
|
"networkmanager"
|
|
];
|
|
};
|
|
home-manager.users.jdoe = {
|
|
home = {
|
|
username = "jdoe";
|
|
homeDirectory = "/home/jdoe";
|
|
};
|
|
jhome = {
|
|
enable = true;
|
|
gui.enable = true;
|
|
dev.rust.enable = true;
|
|
};
|
|
};
|
|
nix.registry.nixpkgs.flake = nixpkgs;
|
|
jconfig = {
|
|
enable = true;
|
|
gui.enable = true;
|
|
};
|
|
}
|
|
];
|
|
};
|
|
|
|
nixosModules = let
|
|
nvim-config.imports = [
|
|
nixvim.homeManagerModules.nixvim
|
|
./nvim
|
|
];
|
|
overlays = builtins.attrValues self.overlays;
|
|
homeManagerModuleSandalone = import ./home {inherit overlays nvim-config stylix;};
|
|
homeManagerModuleNixOS = import ./home {inherit overlays nvim-config;};
|
|
nixosModule = {
|
|
imports =
|
|
[
|
|
(import ./system {inherit stylix;})
|
|
home-manager.nixosModules.home-manager
|
|
]
|
|
++ nixpkgs.lib.optional (lix != null && lix-module != null) lix-module.nixosModules.default;
|
|
home-manager = {
|
|
useGlobalPkgs = true;
|
|
useUserPackages = true;
|
|
sharedModules = [homeManagerModuleNixOS];
|
|
};
|
|
# Pin nixpkgs
|
|
nix.registry.nixpkgs.flake = nixpkgs;
|
|
};
|
|
|
|
machines = [
|
|
"capricorn"
|
|
"gemini"
|
|
"libra"
|
|
"vm"
|
|
];
|
|
mkMachine = hostname: {
|
|
imports = [
|
|
nixosModule
|
|
(import (./machines + "/${hostname}") {inherit nixos-hardware;})
|
|
];
|
|
home-manager.sharedModules = [{jhome.hostName = hostname;}];
|
|
};
|
|
machineModules = lib.genAttrs machines mkMachine;
|
|
in
|
|
{
|
|
default = nixosModule;
|
|
inherit nixosModule homeManagerModuleNixOS homeManagerModuleSandalone;
|
|
}
|
|
// machineModules;
|
|
|
|
devShells = forEachSupportedSystem (
|
|
{
|
|
pkgs,
|
|
system,
|
|
}: {
|
|
default = pkgs.mkShell {
|
|
buildInputs = with pkgs; [
|
|
just
|
|
self.packages.${system}.nvim
|
|
];
|
|
QEMU_OPTS_WL = "--enable-kvm -smp 4 -device virtio-gpu-rutabaga,gfxstream-vulkan=on,cross-domain=on,hostmem=2G,wsi=headless";
|
|
};
|
|
}
|
|
);
|
|
};
|
|
}
|