![github-actions[bot]](/assets/img/avatar_default.png)
Replaced neovim with neovim-nightly-overlay as the flake from neovim was removed. Flake lock file updates: • Updated input 'home-manager': 'github:nix-community/home-manager/44677a1c96810a8e8c4ffaeaad10c842402647c1' (2024-05-12) → 'github:nix-community/home-manager/05e6ba83eb3585ce0aff7b41e4bd0e317d05ad4a' (2024-05-26) • Updated input 'lix': '005ee33a9a
.tar.gz?narHash=sha256-%2Baa9ZALET2yJEDK5wmBUcFjj60/lNQqA4%2BDUPK0wzZE%3D' (2024-05-17) → '5986a720d4
.tar.gz?narHash=sha256-VXsSaj3athaUjgbX9bovTNhSOgevU%2B8qWx9pgaQePdE%3D' (2024-05-26) • Updated input 'lix-module': '53d713eb48
.tar.gz?narHash=sha256-IUFYAl3158Ig5vySnRBHoPReb2/S97bjodCo6FhzJv4%3D' (2024-05-16) → '18fa4a89e2
.tar.gz?narHash=sha256-fzY708SyfHwLOFrg5ZU0fXW9mNdvRvqz64jg97vvpJM%3D' (2024-05-23) • Updated input 'neovim-flake': 'github:neovim/neovim/27fb62988e922c2739035f477f93cc052a4fee1e?dir=contrib' (2024-05-16) → 'github:nix-community/neovim-nightly-overlay/0f91f34a626baade98dfa091cc7a023266644d91' (2024-05-25) • Removed input 'neovim-flake/flake-utils' • Removed input 'neovim-flake/nixpkgs' • Added input 'neovim-src': 'github:neovim/neovim/27fb62988e922c2739035f477f93cc052a4fee1e' (2024-05-16) • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/ff1be1e3cdf884df0935ab28745ab13c3c26d828' (2024-05-16) → 'github:NixOS/nixos-hardware/2e7d6c568063c83355fe066b8a8917ee758de1b8' (2024-05-26) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/33d1e753c82ffc557b4a585c77de43d4c922ebb5' (2024-05-15) → 'github:NixOS/nixpkgs/bfb7a882678e518398ce9a31a881538679f6f092' (2024-05-24) • Updated input 'nixvim': 'github:nix-community/nixvim/72ff1489c7f40dae829fafc689fb6a57099a9739' (2024-05-16) → 'github:nix-community/nixvim/8212bf1cd2d2dfe6ba521dd8c65a13b67e562d1a' (2024-05-26) • Updated input 'nixvim/flake-parts': 'github:hercules-ci/flake-parts/e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e' (2024-05-02) → 'github:hercules-ci/flake-parts/8dc45382d5206bd292f9c2768b8058a8fd8311d9' (2024-05-16) • Updated input 'nixvim/treefmt-nix': 'github:numtide/treefmt-nix/c6aaf729f34a36c445618580a9f95a48f5e4e03f' (2024-04-25) → 'github:numtide/treefmt-nix/2fba33a182602b9d49f0b2440513e5ee091d838b' (2024-05-17) • Updated input 'pre-commit-hooks': 'github:cachix/pre-commit-hooks.nix/fa606cccd7b0ccebe2880051208e4a0f61bfc8c1' (2024-05-16) → 'github:cachix/pre-commit-hooks.nix/0e8fcc54b842ad8428c9e705cb5994eaf05c26a0' (2024-05-20) • Updated input 'stylix': 'github:jalil-salame/stylix/feeb35d2857ef6e32292ebdb862c2f6022c727fd' (2024-05-20) → 'github:jalil-salame/stylix/e5a4701b7d96c4909105a4c2366e4af3f188f802' (2024-05-24)
289 lines
8 KiB
Nix
289 lines
8 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";
|
|
};
|
|
neovim-src = {
|
|
url = "github:neovim/neovim/v0.10.0";
|
|
flake = false;
|
|
};
|
|
neovim-flake = {
|
|
url = "github:nix-community/neovim-nightly-overlay";
|
|
flake = false;
|
|
};
|
|
# 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";
|
|
pre-commit-hooks.follows = "pre-commit-hooks";
|
|
};
|
|
};
|
|
# 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";
|
|
};
|
|
};
|
|
pre-commit-hooks = {
|
|
url = "github:cachix/pre-commit-hooks.nix";
|
|
inputs = {
|
|
nixpkgs.follows = "nixpkgs";
|
|
nixpkgs-stable.follows = "nixpkgs";
|
|
flake-compat.follows = "stylix/flake-compat";
|
|
};
|
|
};
|
|
};
|
|
|
|
# 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";
|
|
};
|
|
}
|
|
);
|
|
};
|
|
}
|