reformat using alejandra
This commit is contained in:
@ -1,5 +1,8 @@
|
|||||||
{ lib, stdenv, src }:
|
{
|
||||||
|
lib,
|
||||||
|
stdenv,
|
||||||
|
src,
|
||||||
|
}:
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
pname = "adwaita-for-steam";
|
pname = "adwaita-for-steam";
|
||||||
version = "unstable";
|
version = "unstable";
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
{ stdenv, lib, pkgs }:
|
{
|
||||||
|
stdenv,
|
||||||
let
|
lib,
|
||||||
|
pkgs,
|
||||||
|
}: let
|
||||||
inherit (pkgs.python310Packages) buildPythonPackage buildPythonApplication fetchPypi;
|
inherit (pkgs.python310Packages) buildPythonPackage buildPythonApplication fetchPypi;
|
||||||
|
|
||||||
# Too old in nixpkgs
|
# Too old in nixpkgs
|
||||||
@ -13,7 +15,7 @@ let
|
|||||||
sha256 = "9107f1ca0b2a5553987a94a3c9959fe5b491fdf731389aa5b7b1bd0733e32de6";
|
sha256 = "9107f1ca0b2a5553987a94a3c9959fe5b491fdf731389aa5b7b1bd0733e32de6";
|
||||||
};
|
};
|
||||||
|
|
||||||
propagatedBuildInputs = with pkgs.python310Packages; [ ];
|
propagatedBuildInputs = with pkgs.python310Packages; [];
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -51,7 +53,7 @@ let
|
|||||||
sha256 = "0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14";
|
sha256 = "0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14";
|
||||||
};
|
};
|
||||||
|
|
||||||
propagatedBuildInputs = with pkgs.python310Packages; [ ];
|
propagatedBuildInputs = with pkgs.python310Packages; [];
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -65,7 +67,7 @@ let
|
|||||||
sha256 = "1cc54630f1f4cbc09654ded012b4a5cd4992aa6ee67442dbba873edd63d01eff";
|
sha256 = "1cc54630f1f4cbc09654ded012b4a5cd4992aa6ee67442dbba873edd63d01eff";
|
||||||
};
|
};
|
||||||
|
|
||||||
propagatedBuildInputs = with pkgs.python310Packages; [ requests ];
|
propagatedBuildInputs = with pkgs.python310Packages; [requests];
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -79,43 +81,35 @@ let
|
|||||||
sha256 = "252a9c6eee001d67bb000ceb8fdf99729c06cf46ff18a00fc89468672388de1e";
|
sha256 = "252a9c6eee001d67bb000ceb8fdf99729c06cf46ff18a00fc89468672388de1e";
|
||||||
};
|
};
|
||||||
|
|
||||||
propagatedBuildInputs = with pkgs.python310Packages; [ requests pycryptodome ];
|
propagatedBuildInputs = with pkgs.python310Packages; [requests pycryptodome];
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: When new version is in nixpkgs update this derivation
|
# TODO: When new version is in nixpkgs update this derivation
|
||||||
# Too old in nixpkgs
|
# Too old in nixpkgs
|
||||||
# my-setuptools = buildPythonPackage rec {
|
# my-setuptools = buildPythonPackage rec {
|
||||||
# version = "65.5.0";
|
# version = "65.5.0";
|
||||||
# pname = "setuptools";
|
# pname = "setuptools";
|
||||||
|
|
||||||
# src = fetchPypi {
|
# src = fetchPypi {
|
||||||
# inherit version pname;
|
# inherit version pname;
|
||||||
# sha256 = "512e5536220e38146176efb833d4a62aa726b7bbff82cfbc8ba9eaa3996e0b17";
|
# sha256 = "512e5536220e38146176efb833d4a62aa726b7bbff82cfbc8ba9eaa3996e0b17";
|
||||||
# };
|
# };
|
||||||
|
|
||||||
# # From https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/development/python-modules/setuptools/default.nix#L75
|
# # From https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/development/python-modules/setuptools/default.nix#L75
|
||||||
# # nativeBuildInputs = [
|
# # nativeBuildInputs = [
|
||||||
# # bootstrapped-pip
|
# # bootstrapped-pip
|
||||||
# # (pipInstallHook.override{pip=null;})
|
# # (pipInstallHook.override{pip=null;})
|
||||||
# # (setuptoolsBuildHook.override{setuptools=null; wheel=null;})
|
# # (setuptoolsBuildHook.override{setuptools=null; wheel=null;})
|
||||||
# # ];
|
# # ];
|
||||||
|
|
||||||
# # preBuild = lib.optionalString (!stdenv.hostPlatform.isWindows) ''
|
# # preBuild = lib.optionalString (!stdenv.hostPlatform.isWindows) ''
|
||||||
# # export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0
|
# # export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0
|
||||||
# # '';
|
# # '';
|
||||||
|
|
||||||
# pipInstallFlags = [ "--ignore-installed" ];
|
# pipInstallFlags = [ "--ignore-installed" ];
|
||||||
|
|
||||||
# # Adds setuptools to nativeBuildInputs causing infinite recursion.
|
# # Adds setuptools to nativeBuildInputs causing infinite recursion.
|
||||||
# # catchConflicts = false;
|
# # catchConflicts = false;
|
||||||
|
|
||||||
# propagatedBuildInputs = with pkgs.python310Packages; [ ];
|
# propagatedBuildInputs = with pkgs.python310Packages; [ ];
|
||||||
# doCheck = false;
|
# doCheck = false;
|
||||||
# };
|
# };
|
||||||
|
in
|
||||||
|
buildPythonApplication rec {
|
||||||
in buildPythonApplication rec {
|
|
||||||
version = "3.4.14";
|
version = "3.4.14";
|
||||||
pname = "cyberdrop-dl";
|
pname = "cyberdrop-dl";
|
||||||
|
|
||||||
@ -150,4 +144,4 @@ in buildPythonApplication rec {
|
|||||||
description = "Bulk downloader for multiple file hosts";
|
description = "Bulk downloader for multiple file hosts";
|
||||||
license = licenses.gpl3Only;
|
license = licenses.gpl3Only;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -3,10 +3,7 @@
|
|||||||
# /nix/store/z3gxkwakzgiswvakfrpbirhpcach509j-mutter-42.3/share/gsettings-schemas/mutter-42.3
|
# /nix/store/z3gxkwakzgiswvakfrpbirhpcach509j-mutter-42.3/share/gsettings-schemas/mutter-42.3
|
||||||
# but this is the wrong path for dconf-editor to find the schema, correct one would be
|
# but this is the wrong path for dconf-editor to find the schema, correct one would be
|
||||||
# /nix/store/z3gxkwakzgiswvakfrpbirhpcach509j-mutter-42.3/share/gsettings-schemas/mutter-42.3/glib-2.0/schemas
|
# /nix/store/z3gxkwakzgiswvakfrpbirhpcach509j-mutter-42.3/share/gsettings-schemas/mutter-42.3/glib-2.0/schemas
|
||||||
|
{pkgs}: let
|
||||||
{ pkgs }:
|
|
||||||
|
|
||||||
let
|
|
||||||
find-gsettings-schemas = pkgs.callPackage ./find-gsettings-schemas.nix {};
|
find-gsettings-schemas = pkgs.callPackage ./find-gsettings-schemas.nix {};
|
||||||
|
|
||||||
dconf-editor-wrapped = pkgs.writeShellScriptBin "dconf-editor-wrapped" ''
|
dconf-editor-wrapped = pkgs.writeShellScriptBin "dconf-editor-wrapped" ''
|
||||||
@ -20,7 +17,7 @@ let
|
|||||||
icon = "ca.desrt.dconf-editor";
|
icon = "ca.desrt.dconf-editor";
|
||||||
comment = "Modify the Gnome/GTK settings database";
|
comment = "Modify the Gnome/GTK settings database";
|
||||||
genericName = "Desktop application to manage Gnome/GTK settings.";
|
genericName = "Desktop application to manage Gnome/GTK settings.";
|
||||||
categories = [ "GNOME" "GTK" "System" ];
|
categories = ["GNOME" "GTK" "System"];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
# Combine multiple derivations into a single store path
|
# Combine multiple derivations into a single store path
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{pkgs, ...}:
|
||||||
|
|
||||||
pkgs.writeShellScriptBin "find-gsettings-schemas" ''
|
pkgs.writeShellScriptBin "find-gsettings-schemas" ''
|
||||||
schemas=""
|
schemas=""
|
||||||
for d in $(ls -1 --ignore "*.drv" /nix/store); do
|
for d in $(ls -1 --ignore "*.drv" /nix/store); do
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
{ inputs, pkgs }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
inputs,
|
||||||
|
pkgs,
|
||||||
|
}: {
|
||||||
# vital-synth = pkgs.callPackage ./vital-synth {}; # Kept as an example, don't know if I will fix this or keep using distrho
|
# vital-synth = pkgs.callPackage ./vital-synth {}; # Kept as an example, don't know if I will fix this or keep using distrho
|
||||||
cyberdrop-dl = pkgs.callPackage ./cyberdrop-dl {};
|
cyberdrop-dl = pkgs.callPackage ./cyberdrop-dl {};
|
||||||
firefox-gnome-theme = pkgs.callPackage ./firefox-gnome-theme { src = inputs.firefox-gnome-theme; };
|
firefox-gnome-theme = pkgs.callPackage ./firefox-gnome-theme {src = inputs.firefox-gnome-theme;};
|
||||||
adwaita-for-steam = pkgs.callPackage ./adwaita-for-steam { src = inputs.adwaita-for-steam; };
|
adwaita-for-steam = pkgs.callPackage ./adwaita-for-steam {src = inputs.adwaita-for-steam;};
|
||||||
dconf-editor-wrapped = pkgs.callPackage ./dconf-editor-wrapped {};
|
dconf-editor-wrapped = pkgs.callPackage ./dconf-editor-wrapped {};
|
||||||
bitwig-studio-pipewire = pkgs.callPackage ./bitwig-studio-pipewire {};
|
bitwig-studio-pipewire = pkgs.callPackage ./bitwig-studio-pipewire {};
|
||||||
oversteer = pkgs.callPackage ./oversteer {};
|
oversteer = pkgs.callPackage ./oversteer {};
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
# Taken from https://github.com/tadfisher/flake/blob/main/pkgs/firefox-gnome-theme/default.nix
|
# Taken from https://github.com/tadfisher/flake/blob/main/pkgs/firefox-gnome-theme/default.nix
|
||||||
|
|
||||||
# We don't use fetchTarbal or fetchFromGithub because we are using flakes:
|
# We don't use fetchTarbal or fetchFromGithub because we are using flakes:
|
||||||
# - Specify the firefox-gnome-theme github repo as input in flake.nix
|
# - Specify the firefox-gnome-theme github repo as input in flake.nix
|
||||||
# - We don't need to add sha256 or commit revision because it is automatically locked in flake.lock
|
# - We don't need to add sha256 or commit revision because it is automatically locked in flake.lock
|
||||||
# - Pass the input to overlays/default.nix and from there to derivations/default.nix
|
# - Pass the input to overlays/default.nix and from there to derivations/default.nix
|
||||||
# - There we plug the input into the src argument of this derivation
|
# - There we plug the input into the src argument of this derivation
|
||||||
|
{
|
||||||
{ lib, stdenv, src }:
|
lib,
|
||||||
|
stdenv,
|
||||||
|
src,
|
||||||
|
}:
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
pname = "firefox-gnome-theme";
|
pname = "firefox-gnome-theme";
|
||||||
version = "unstable";
|
version = "unstable";
|
||||||
|
@ -1,8 +1,23 @@
|
|||||||
# Taken from https://github.com/NixOS/nixpkgs/pull/176779/files
|
# Taken from https://github.com/NixOS/nixpkgs/pull/176779/files
|
||||||
|
{
|
||||||
{ lib, stdenv, meson, ninja, pkg-config, gettext, cmake, udev, fetchFromGitHub, python3
|
lib,
|
||||||
, wrapGAppsHook, gtk3, glib, gnome, appstream-glib, gobject-introspection, desktop-file-utils }:
|
stdenv,
|
||||||
|
meson,
|
||||||
|
ninja,
|
||||||
|
pkg-config,
|
||||||
|
gettext,
|
||||||
|
cmake,
|
||||||
|
udev,
|
||||||
|
fetchFromGitHub,
|
||||||
|
python3,
|
||||||
|
wrapGAppsHook,
|
||||||
|
gtk3,
|
||||||
|
glib,
|
||||||
|
gnome,
|
||||||
|
appstream-glib,
|
||||||
|
gobject-introspection,
|
||||||
|
desktop-file-utils,
|
||||||
|
}:
|
||||||
python3.pkgs.buildPythonApplication rec {
|
python3.pkgs.buildPythonApplication rec {
|
||||||
pname = "oversteer";
|
pname = "oversteer";
|
||||||
version = "0.7.1";
|
version = "0.7.1";
|
||||||
@ -44,9 +59,9 @@ python3.pkgs.buildPythonApplication rec {
|
|||||||
udev
|
udev
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [ udev gtk3 glib gnome.adwaita-icon-theme python3 ];
|
buildInputs = [udev gtk3 glib gnome.adwaita-icon-theme python3];
|
||||||
|
|
||||||
propagatedBuildInputs = with python3.pkgs; [ pyudev pyxdg evdev pygobject3 matplotlib scipy ];
|
propagatedBuildInputs = with python3.pkgs; [pyudev pyxdg evdev pygobject3 matplotlib scipy];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Application to configure Logitech steering wheels on Linux";
|
description = "Application to configure Logitech steering wheels on Linux";
|
||||||
|
@ -1,33 +1,30 @@
|
|||||||
# Has a problem with vertically offset UI, replaced by distrho for now but kept as an example
|
# Has a problem with vertically offset UI, replaced by distrho for now but kept as an example
|
||||||
|
|
||||||
# TODO: Flake derivation
|
# TODO: Flake derivation
|
||||||
|
|
||||||
# Damn I hate this style
|
# Damn I hate this style
|
||||||
{ lib
|
{
|
||||||
, stdenv
|
lib,
|
||||||
, fetchurl
|
stdenv,
|
||||||
, dpkg
|
fetchurl,
|
||||||
, autoPatchelfHook
|
dpkg,
|
||||||
, alsa-lib
|
autoPatchelfHook,
|
||||||
, freetype
|
alsa-lib,
|
||||||
, gcc
|
freetype,
|
||||||
, glib
|
gcc,
|
||||||
, glibc
|
glib,
|
||||||
, curlWithGnuTls
|
glibc,
|
||||||
, libGL
|
curlWithGnuTls,
|
||||||
, libglvnd
|
libGL,
|
||||||
, libsecret
|
libglvnd,
|
||||||
|
libsecret,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
# Adapted from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vital-synth
|
# Adapted from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vital-synth
|
||||||
# Example https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/audio/bitwig-studio/bitwig-studio4.nix
|
# Example https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/audio/bitwig-studio/bitwig-studio4.nix
|
||||||
|
|
||||||
let
|
let
|
||||||
# Variables from AUR pkgbuild
|
# Variables from AUR pkgbuild
|
||||||
maintainer = "jackreeds";
|
maintainer = "jackreeds";
|
||||||
pkgname_deb = "VitalInstaller";
|
pkgname_deb = "VitalInstaller";
|
||||||
|
in
|
||||||
in stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "vital-synth";
|
pname = "vital-synth";
|
||||||
version = "1.0.8";
|
version = "1.0.8";
|
||||||
|
|
||||||
@ -63,7 +60,16 @@ in stdenv.mkDerivation rec {
|
|||||||
# depends=('alsa-lib>=1.0.16' 'freetype2>=2.2.1' 'gcc-libs' 'gcc>=3.3.1' 'glib2>=2.12.0' 'glibc>=2.17'
|
# depends=('alsa-lib>=1.0.16' 'freetype2>=2.2.1' 'gcc-libs' 'gcc>=3.3.1' 'glib2>=2.12.0' 'glibc>=2.17'
|
||||||
# 'libcurl-gnutls>=7.16.2' 'libgl' 'libglvnd' 'libsecret>=0.7')
|
# 'libcurl-gnutls>=7.16.2' 'libgl' 'libglvnd' 'libsecret>=0.7')
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
alsa-lib freetype gcc.cc.lib gcc.cc glib glibc curlWithGnuTls libGL libglvnd libsecret
|
alsa-lib
|
||||||
|
freetype
|
||||||
|
gcc.cc.lib
|
||||||
|
gcc.cc
|
||||||
|
glib
|
||||||
|
glibc
|
||||||
|
curlWithGnuTls
|
||||||
|
libGL
|
||||||
|
libglvnd
|
||||||
|
libsecret
|
||||||
];
|
];
|
||||||
|
|
||||||
# Copy the contents of the .deb package to the $out directory that nix creates for built derivations
|
# Copy the contents of the .deb package to the $out directory that nix creates for built derivations
|
||||||
@ -85,6 +91,6 @@ in stdenv.mkDerivation rec {
|
|||||||
'';
|
'';
|
||||||
homepage = "https://vital.audio/";
|
homepage = "https://vital.audio/";
|
||||||
license = licenses.gpl3Only;
|
license = licenses.gpl3Only;
|
||||||
platforms = [ "x86_64-linux" ];
|
platforms = ["x86_64-linux"];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
12
env/c_cxx.nix
vendored
12
env/c_cxx.nix
vendored
@ -5,13 +5,17 @@
|
|||||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||||
inputs.devshell.url = "github:numtide/devshell";
|
inputs.devshell.url = "github:numtide/devshell";
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, devshell }:
|
outputs = {
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
self,
|
||||||
let
|
nixpkgs,
|
||||||
|
flake-utils,
|
||||||
|
devshell,
|
||||||
|
}:
|
||||||
|
flake-utils.lib.eachDefaultSystem (system: let
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true; # For clion
|
config.allowUnfree = true; # For clion
|
||||||
overlays = [ devshell.overlay ];
|
overlays = [devshell.overlay];
|
||||||
};
|
};
|
||||||
|
|
||||||
# NOTE: Usual 64 bit compilers that don't collide
|
# NOTE: Usual 64 bit compilers that don't collide
|
||||||
|
15
env/python.nix
vendored
15
env/python.nix
vendored
@ -5,16 +5,21 @@
|
|||||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||||
inputs.devshell.url = "github:numtide/devshell";
|
inputs.devshell.url = "github:numtide/devshell";
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, devshell }:
|
outputs = {
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
self,
|
||||||
let
|
nixpkgs,
|
||||||
|
flake-utils,
|
||||||
|
devshell,
|
||||||
|
}:
|
||||||
|
flake-utils.lib.eachDefaultSystem (system: let
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
overlays = [ devshell.overlay ];
|
overlays = [devshell.overlay];
|
||||||
};
|
};
|
||||||
|
|
||||||
myPython = pkgs.python310.withPackages (p: with p; [
|
myPython = pkgs.python310.withPackages (p:
|
||||||
|
with p; [
|
||||||
rich
|
rich
|
||||||
numpy
|
numpy
|
||||||
scipy
|
scipy
|
||||||
|
15
env/python_pytorch.nix
vendored
15
env/python_pytorch.nix
vendored
@ -5,13 +5,17 @@
|
|||||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||||
inputs.devshell.url = "github:numtide/devshell";
|
inputs.devshell.url = "github:numtide/devshell";
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, devshell }:
|
outputs = {
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
self,
|
||||||
let
|
nixpkgs,
|
||||||
|
flake-utils,
|
||||||
|
devshell,
|
||||||
|
}:
|
||||||
|
flake-utils.lib.eachDefaultSystem (system: let
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
overlays = [ devshell.overlay ];
|
overlays = [devshell.overlay];
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: Originally it was nixpkgs.fetchurl but that didn't work, pkgs.fetchurl did...
|
# TODO: Originally it was nixpkgs.fetchurl but that didn't work, pkgs.fetchurl did...
|
||||||
@ -37,7 +41,8 @@
|
|||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
|
|
||||||
myPython = pkgs.python310.withPackages (p: with p; [
|
myPython = pkgs.python310.withPackages (p:
|
||||||
|
with p; [
|
||||||
# Basic
|
# Basic
|
||||||
rich
|
rich
|
||||||
|
|
||||||
|
13
env/rust.nix
vendored
13
env/rust.nix
vendored
@ -6,9 +6,14 @@
|
|||||||
inputs.devshell.url = "github:numtide/devshell";
|
inputs.devshell.url = "github:numtide/devshell";
|
||||||
inputs.rust-overlay.url = "github:oxalica/rust-overlay";
|
inputs.rust-overlay.url = "github:oxalica/rust-overlay";
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, devshell, rust-overlay }:
|
outputs = {
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
self,
|
||||||
let
|
nixpkgs,
|
||||||
|
flake-utils,
|
||||||
|
devshell,
|
||||||
|
rust-overlay,
|
||||||
|
}:
|
||||||
|
flake-utils.lib.eachDefaultSystem (system: let
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true; # For clion
|
config.allowUnfree = true; # For clion
|
||||||
@ -20,7 +25,7 @@
|
|||||||
|
|
||||||
# Includes cargo, rustc, rustfmt
|
# Includes cargo, rustc, rustfmt
|
||||||
rust-stable = pkgs.rust-bin.stable.latest.default.override {
|
rust-stable = pkgs.rust-bin.stable.latest.default.override {
|
||||||
extensions = [ "rust-src" ]; # Include the rust stdlib source for intellij
|
extensions = ["rust-src"]; # Include the rust stdlib source for intellij
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
devShell = pkgs.devshell.mkShell {
|
devShell = pkgs.devshell.mkShell {
|
||||||
|
24
flake.nix
24
flake.nix
@ -1,5 +1,4 @@
|
|||||||
# The curly braces denote a set of keys and values.
|
# The curly braces denote a set of keys and values.
|
||||||
|
|
||||||
{
|
{
|
||||||
description = "ChUrl's very bad and basic Nix config using Flakes";
|
description = "ChUrl's very bad and basic Nix config using Flakes";
|
||||||
|
|
||||||
@ -39,8 +38,11 @@
|
|||||||
# Outputs is a function that takes the inputs as arguments.
|
# Outputs is a function that takes the inputs as arguments.
|
||||||
# To handle extra arguments we use the inputs@ pattern.
|
# To handle extra arguments we use the inputs@ pattern.
|
||||||
# It gives a name to the ... ellipses.
|
# It gives a name to the ... ellipses.
|
||||||
outputs = inputs @ { nixpkgs, home-manager, ... }:
|
outputs = inputs @ {
|
||||||
|
nixpkgs,
|
||||||
|
home-manager,
|
||||||
|
...
|
||||||
|
}:
|
||||||
# With let you can define local variables
|
# With let you can define local variables
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
@ -56,24 +58,24 @@
|
|||||||
inputs.emacs-overlay.overlay
|
inputs.emacs-overlay.overlay
|
||||||
|
|
||||||
# All my own overlays
|
# All my own overlays
|
||||||
(import ./overlays { inherit nixpkgs inputs; })
|
(import ./overlays {inherit nixpkgs inputs;})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# I don't know how to extend the nixpkgs.lib directly so just propagate mylib to the config modules as argument
|
# I don't know how to extend the nixpkgs.lib directly so just propagate mylib to the config modules as argument
|
||||||
mylib = import ./lib { inherit inputs pkgs; lib = nixpkgs.lib; };
|
mylib = import ./lib {
|
||||||
|
inherit inputs pkgs;
|
||||||
|
lib = nixpkgs.lib;
|
||||||
|
};
|
||||||
# The rec expression turns a basic set into a set where self-referencing is possible.
|
# The rec expression turns a basic set into a set where self-referencing is possible.
|
||||||
# It is a shorthand for recursive and allows to use the values defined in this set from its own scope.
|
# It is a shorthand for recursive and allows to use the values defined in this set from its own scope.
|
||||||
in rec {
|
in rec {
|
||||||
|
|
||||||
# Local shell for NixFlake directory
|
# Local shell for NixFlake directory
|
||||||
devShells."${system}".default = import ./shell.nix { inherit pkgs; };
|
devShells."${system}".default = import ./shell.nix {inherit pkgs;};
|
||||||
|
|
||||||
# System configurations + HomeManager module
|
# System configurations + HomeManager module
|
||||||
# Accessible via 'nixos-rebuild'
|
# Accessible via 'nixos-rebuild'
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
|
|
||||||
# We give our configuration a name (the hostname) to choose a configuration when rebuilding.
|
# We give our configuration a name (the hostname) to choose a configuration when rebuilding.
|
||||||
# This makes it easy to add different configurations (e.g. for a laptop).
|
# This makes it easy to add different configurations (e.g. for a laptop).
|
||||||
# Usage: sudo nixos-rebuild switch --flake .#nixinator
|
# Usage: sudo nixos-rebuild switch --flake .#nixinator
|
||||||
@ -83,7 +85,7 @@
|
|||||||
hostname = "nixinator";
|
hostname = "nixinator";
|
||||||
username = "christoph";
|
username = "christoph";
|
||||||
|
|
||||||
extraModules = [ ];
|
extraModules = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Usage: sudo nixos-rebuild switch --flake .#nixtop
|
# Usage: sudo nixos-rebuild switch --flake .#nixtop
|
||||||
@ -93,7 +95,7 @@
|
|||||||
hostname = "nixtop";
|
hostname = "nixtop";
|
||||||
username = "christoph";
|
username = "christoph";
|
||||||
|
|
||||||
extraModules = [ ];
|
extraModules = [];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,17 +1,22 @@
|
|||||||
# This is your home-manager configuration file
|
# This is your home-manager configuration file
|
||||||
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
|
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
|
||||||
|
|
||||||
# The nixosConfig allows to access the toplevel system configuration from within home manager
|
# The nixosConfig allows to access the toplevel system configuration from within home manager
|
||||||
# https://github.com/nix-community/home-manager/blob/586ac1fd58d2de10b926ce3d544b3179891e58cb/nixos/default.nix#L19
|
# https://github.com/nix-community/home-manager/blob/586ac1fd58d2de10b926ce3d544b3179891e58cb/nixos/default.nix#L19
|
||||||
{ inputs, hostname, username, lib, mylib, config, nixosConfig, pkgs, ... }:
|
{
|
||||||
|
inputs,
|
||||||
|
hostname,
|
||||||
|
username,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
config,
|
||||||
|
nixosConfig,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
# This is a module
|
# This is a module
|
||||||
# Because no imports/options/config is defined explicitly, everything is treated as config
|
# Because no imports/options/config is defined explicitly, everything is treated as config
|
||||||
# { inputs, lib, ... }: { ... } gets turned into { inputs, lib, ... }: { config = { ... }; } implicitly
|
# { inputs, lib, ... }: { ... } gets turned into { inputs, lib, ... }: { config = { ... }; } implicitly
|
||||||
let
|
rec {
|
||||||
|
|
||||||
in rec {
|
|
||||||
|
|
||||||
# Every module is a nix expression, specifically a function { inputs, lib, ... }: { ... }
|
# Every module is a nix expression, specifically a function { inputs, lib, ... }: { ... }
|
||||||
# Every module (/function) is called with the same arguments as this module (home.nix)
|
# Every module (/function) is called with the same arguments as this module (home.nix)
|
||||||
# Arguments with matching names are "plugged in" into the right slots,
|
# Arguments with matching names are "plugged in" into the right slots,
|
||||||
@ -214,7 +219,7 @@ in rec {
|
|||||||
ffmpeg_5-full # v5, including ffplay
|
ffmpeg_5-full # v5, including ffplay
|
||||||
imagemagick # Convert image (magic)
|
imagemagick # Convert image (magic)
|
||||||
httpie # Cool http client
|
httpie # Cool http client
|
||||||
(ripgrep.override { withPCRE2 = true; }) # fast as fuck
|
(ripgrep.override {withPCRE2 = true;}) # fast as fuck
|
||||||
nvd # nix rebuild diff
|
nvd # nix rebuild diff
|
||||||
# du-dust # Disk usage analyzer (for directories)
|
# du-dust # Disk usage analyzer (for directories)
|
||||||
gdu # Alternative to du-dust (I like it better)
|
gdu # Alternative to du-dust (I like it better)
|
||||||
@ -241,6 +246,8 @@ in rec {
|
|||||||
texlive.combined.scheme-full
|
texlive.combined.scheme-full
|
||||||
pandoc # document converting madness
|
pandoc # document converting madness
|
||||||
lm_sensors
|
lm_sensors
|
||||||
|
alejandra # nix code formatter
|
||||||
|
nil # nix language server
|
||||||
|
|
||||||
# Xooooorg/Desktop environment stuff
|
# Xooooorg/Desktop environment stuff
|
||||||
xclip
|
xclip
|
||||||
@ -302,7 +309,6 @@ in rec {
|
|||||||
# jetbrains.idea-ultimate
|
# jetbrains.idea-ultimate
|
||||||
# jetbrains.clion
|
# jetbrains.clion
|
||||||
|
|
||||||
|
|
||||||
# TODO: LaTeX module
|
# TODO: LaTeX module
|
||||||
texlab
|
texlab
|
||||||
|
|
||||||
@ -342,6 +348,8 @@ in rec {
|
|||||||
|
|
||||||
# Use NixCommunity binary cache
|
# Use NixCommunity binary cache
|
||||||
cachix
|
cachix
|
||||||
|
|
||||||
|
# tor-browser-bundle-bin
|
||||||
];
|
];
|
||||||
|
|
||||||
# Packages with extra options managed by HomeManager natively
|
# Packages with extra options managed by HomeManager natively
|
||||||
@ -411,8 +419,8 @@ in rec {
|
|||||||
enable = true;
|
enable = true;
|
||||||
enableFishIntegration = config.modules.fish.enable;
|
enableFishIntegration = config.modules.fish.enable;
|
||||||
enableXsessionIntegration = true;
|
enableXsessionIntegration = true;
|
||||||
agents = [ "ssh" ];
|
agents = ["ssh"];
|
||||||
keys = [ "id_ed25519" ];
|
keys = ["id_ed25519"];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Realtime Motion Interpolation: https://gist.github.com/phiresky/4bfcfbbd05b3c2ed8645
|
# Realtime Motion Interpolation: https://gist.github.com/phiresky/4bfcfbbd05b3c2ed8645
|
||||||
@ -421,10 +429,13 @@ in rec {
|
|||||||
# NOTE: wrapMpv explained here: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/applications/video/mpv/wrapper.nix#L84
|
# NOTE: wrapMpv explained here: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/applications/video/mpv/wrapper.nix#L84
|
||||||
# wrapMpv gets two args: the mpv derivation and some options
|
# wrapMpv gets two args: the mpv derivation and some options
|
||||||
# Possible overrides for derivation: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/applications/video/mpv/default.nix#L222
|
# Possible overrides for derivation: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/applications/video/mpv/default.nix#L222
|
||||||
package = pkgs.wrapMpv (pkgs.mpv-unwrapped.override { vapoursynthSupport = true; }) {
|
package = pkgs.wrapMpv (pkgs.mpv-unwrapped.override {vapoursynthSupport = true;}) {
|
||||||
youtubeSupport = true;
|
youtubeSupport = true;
|
||||||
extraMakeWrapperArgs = [
|
extraMakeWrapperArgs = [
|
||||||
"--prefix" "LD_LIBRARY_PATH" ":" "${pkgs.vapoursynth-mvtools}/lib"
|
"--prefix"
|
||||||
|
"LD_LIBRARY_PATH"
|
||||||
|
":"
|
||||||
|
"${pkgs.vapoursynth-mvtools}/lib"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,15 @@
|
|||||||
{ inputs, hostname, username, lib, mylib, config, nixosConfig, pkgs, ... }:
|
{
|
||||||
|
inputs,
|
||||||
|
hostname,
|
||||||
|
username,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
config,
|
||||||
|
nixosConfig,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
# Here goes the stuff that will only be enabled on the desktop
|
# Here goes the stuff that will only be enabled on the desktop
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
imports = [
|
imports = [
|
||||||
../../modules
|
../../modules
|
||||||
@ -21,8 +29,10 @@ rec {
|
|||||||
yabridge.autoSync = true;
|
yabridge.autoSync = true;
|
||||||
|
|
||||||
noisesuppression = {
|
noisesuppression = {
|
||||||
noisetorch.enable = true;
|
noisetorch.enable = false;
|
||||||
noisetorch.autostart = true;
|
noisetorch.autostart = false;
|
||||||
|
easyeffects.enable = false;
|
||||||
|
easyeffects.autostart = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
cardinal.enable = true;
|
cardinal.enable = true;
|
||||||
|
@ -1,7 +1,15 @@
|
|||||||
{ inputs, hostname, username, lib, mylib, config, nixosConfig, pkgs, ... }:
|
{
|
||||||
|
inputs,
|
||||||
|
hostname,
|
||||||
|
username,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
config,
|
||||||
|
nixosConfig,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
# Here goes the stuff that will only be enabled on the laptop
|
# Here goes the stuff that will only be enabled on the laptop
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
imports = [
|
imports = [
|
||||||
../../modules
|
../../modules
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
{ config, nixosConfig, lib, mylib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
nixosConfig,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
with mylib.modules;
|
with mylib.modules; let
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.audio;
|
cfg = config.modules.audio;
|
||||||
cfgfp = config.modules.flatpak;
|
cfgfp = config.modules.flatpak;
|
||||||
in {
|
in {
|
||||||
@ -64,8 +68,8 @@ in {
|
|||||||
|
|
||||||
# Use builtins.concatLists instead of mkMerge as this is more safe as the type is specified,
|
# Use builtins.concatLists instead of mkMerge as this is more safe as the type is specified,
|
||||||
# also mkMerge doesn't work in every case as it yields a set
|
# also mkMerge doesn't work in every case as it yields a set
|
||||||
home.packages = with pkgs; builtins.concatLists [
|
home.packages = with pkgs;
|
||||||
|
builtins.concatLists [
|
||||||
# lib.optional is preferred over mkIf or if...then...else by nix coding standards
|
# lib.optional is preferred over mkIf or if...then...else by nix coding standards
|
||||||
# lib.optional wraps its argument in a list, lib.optionals doesn't
|
# lib.optional wraps its argument in a list, lib.optionals doesn't
|
||||||
# This means that lib.optional can be used for single packages/arguments
|
# This means that lib.optional can be used for single packages/arguments
|
||||||
@ -75,23 +79,23 @@ in {
|
|||||||
# Some of these include gamemode as I use that to enable performance governors for CPU/GPU and other stuff
|
# Some of these include gamemode as I use that to enable performance governors for CPU/GPU and other stuff
|
||||||
|
|
||||||
# Enable some default pipewire stuff if pipewire is enabled
|
# Enable some default pipewire stuff if pipewire is enabled
|
||||||
(optionals nixosConfig.services.pipewire.enable [ helvum ])
|
(optionals nixosConfig.services.pipewire.enable [helvum])
|
||||||
|
|
||||||
(optionals cfg.carla.enable [ carla gamemode ])
|
(optionals cfg.carla.enable [carla gamemode])
|
||||||
(optionals cfg.bitwig.enable [
|
(optionals cfg.bitwig.enable [
|
||||||
bitwig-studio
|
bitwig-studio
|
||||||
gamemode
|
gamemode
|
||||||
])
|
])
|
||||||
(optionals cfg.tenacity.enable [ tenacity ])
|
(optionals cfg.tenacity.enable [tenacity])
|
||||||
|
|
||||||
(optionals cfg.faust.enable [ faust ])
|
(optionals cfg.faust.enable [faust])
|
||||||
(optionals cfg.yabridge.enable [ yabridge yabridgectl ])
|
(optionals cfg.yabridge.enable [yabridge yabridgectl])
|
||||||
(optionals cfg.noisesuppression.noisetorch.enable [ noisetorch ])
|
(optionals cfg.noisesuppression.noisetorch.enable [noisetorch])
|
||||||
|
|
||||||
# (optionals cfg.vcvrack.enable [ vcv-rack ]) # Replaced by cardinal
|
# (optionals cfg.vcvrack.enable [ vcv-rack ]) # Replaced by cardinal
|
||||||
(optionals cfg.cardinal.enable [ cardinal ])
|
(optionals cfg.cardinal.enable [cardinal])
|
||||||
# (optionals cfg.vital.enable [ vital-synth ]) # Replaced by distrho
|
# (optionals cfg.vital.enable [ vital-synth ]) # Replaced by distrho
|
||||||
(optionals cfg.distrho.enable [ distrho ])
|
(optionals cfg.distrho.enable [distrho])
|
||||||
];
|
];
|
||||||
|
|
||||||
services.easyeffects = mkIf cfg.noisesuppression.easyeffects.enable {
|
services.easyeffects = mkIf cfg.noisesuppression.easyeffects.enable {
|
||||||
@ -107,7 +111,7 @@ in {
|
|||||||
icon = "carla";
|
icon = "carla";
|
||||||
exec = "env PIPEWIRE_LATENCY=256/48000 gamemoderun carla ${config.home.homeDirectory}/.config/carla/GuitarDefault.carxp";
|
exec = "env PIPEWIRE_LATENCY=256/48000 gamemoderun carla ${config.home.homeDirectory}/.config/carla/GuitarDefault.carxp";
|
||||||
terminal = false;
|
terminal = false;
|
||||||
categories = [ "Music" "Audio" ];
|
categories = ["Music" "Audio"];
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.desktopEntries.bitwig-low-latency = mkIf cfg.bitwig.enable {
|
xdg.desktopEntries.bitwig-low-latency = mkIf cfg.bitwig.enable {
|
||||||
@ -116,7 +120,7 @@ in {
|
|||||||
icon = "bitwig-studio";
|
icon = "bitwig-studio";
|
||||||
exec = "env PIPEWIRE_LATENCY=256/48000 gamemoderun bitwig-studio";
|
exec = "env PIPEWIRE_LATENCY=256/48000 gamemoderun bitwig-studio";
|
||||||
terminal = false;
|
terminal = false;
|
||||||
categories = [ "Music" "Audio" ];
|
categories = ["Music" "Audio"];
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: Disable only for plasma
|
# TODO: Disable only for plasma
|
||||||
@ -147,11 +151,13 @@ in {
|
|||||||
home.activation = mkMerge [
|
home.activation = mkMerge [
|
||||||
# The module includes the default carla project with ArchetypePetrucci + ArchetypeGojira
|
# The module includes the default carla project with ArchetypePetrucci + ArchetypeGojira
|
||||||
(mkIf cfg.carla.enable {
|
(mkIf cfg.carla.enable {
|
||||||
linkCarlaConfig = hm.dag.entryAfter [ "writeBoundary" ]
|
linkCarlaConfig =
|
||||||
|
hm.dag.entryAfter ["writeBoundary"]
|
||||||
(mkLink "${config.home.homeDirectory}/NixFlake/config/carla" "${config.home.homeDirectory}/.config/carla");
|
(mkLink "${config.home.homeDirectory}/NixFlake/config/carla" "${config.home.homeDirectory}/.config/carla");
|
||||||
})
|
})
|
||||||
(mkElse cfg.carla.enable {
|
(mkElse cfg.carla.enable {
|
||||||
unlinkCarlaConfig = hm.dag.entryAfter [ "writeBoundary" ]
|
unlinkCarlaConfig =
|
||||||
|
hm.dag.entryAfter ["writeBoundary"]
|
||||||
(mkUnlink "${config.home.homeDirectory}/.config/carla");
|
(mkUnlink "${config.home.homeDirectory}/.config/carla");
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -166,24 +172,30 @@ in {
|
|||||||
# })
|
# })
|
||||||
|
|
||||||
(mkIf cfg.distrho.enable {
|
(mkIf cfg.distrho.enable {
|
||||||
linkDistrhoLV2 = hm.dag.entryAfter [ "writeBoundary" ]
|
linkDistrhoLV2 =
|
||||||
|
hm.dag.entryAfter ["writeBoundary"]
|
||||||
(mkLink "${pkgs.distrho}/lib/lv2" "${config.home.homeDirectory}/.lv2/distrho");
|
(mkLink "${pkgs.distrho}/lib/lv2" "${config.home.homeDirectory}/.lv2/distrho");
|
||||||
linkDistrhoVST = hm.dag.entryAfter [ "writeBoundary" ]
|
linkDistrhoVST =
|
||||||
|
hm.dag.entryAfter ["writeBoundary"]
|
||||||
(mkLink "${pkgs.distrho}/lib/vst" "${config.home.homeDirectory}/.vst/distrho");
|
(mkLink "${pkgs.distrho}/lib/vst" "${config.home.homeDirectory}/.vst/distrho");
|
||||||
linkDistrhoVST3 = hm.dag.entryAfter [ "writeBoundary" ]
|
linkDistrhoVST3 =
|
||||||
|
hm.dag.entryAfter ["writeBoundary"]
|
||||||
(mkLink "${pkgs.distrho}/lib/vst3" "${config.home.homeDirectory}/.vst3/distrho");
|
(mkLink "${pkgs.distrho}/lib/vst3" "${config.home.homeDirectory}/.vst3/distrho");
|
||||||
})
|
})
|
||||||
(mkElse cfg.distrho.enable {
|
(mkElse cfg.distrho.enable {
|
||||||
unlinkDistrhoLV2 = hm.dag.entryAfter [ "writeBoundary" ]
|
unlinkDistrhoLV2 =
|
||||||
|
hm.dag.entryAfter ["writeBoundary"]
|
||||||
(mkUnlink "${config.home.homeDirectory}/.lv2/distrho");
|
(mkUnlink "${config.home.homeDirectory}/.lv2/distrho");
|
||||||
unlinkDistrhoVST = hm.dag.entryAfter [ "writeBoundary" ]
|
unlinkDistrhoVST =
|
||||||
|
hm.dag.entryAfter ["writeBoundary"]
|
||||||
(mkUnlink "${config.home.homeDirectory}/.vst/distrho");
|
(mkUnlink "${config.home.homeDirectory}/.vst/distrho");
|
||||||
unlinkDistrhoVST3 = hm.dag.entryAfter [ "writeBoundary" ]
|
unlinkDistrhoVST3 =
|
||||||
|
hm.dag.entryAfter ["writeBoundary"]
|
||||||
(mkUnlink "${config.home.homeDirectory}/.vst3/distrho");
|
(mkUnlink "${config.home.homeDirectory}/.vst3/distrho");
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf (cfg.yabridge.enable && cfg.yabridge.autoSync) {
|
(mkIf (cfg.yabridge.enable && cfg.yabridge.autoSync) {
|
||||||
syncYabridge = hm.dag.entryAfter [ "writeBoundary" ] ''
|
syncYabridge = hm.dag.entryAfter ["writeBoundary"] ''
|
||||||
yabridgectl sync
|
yabridgectl sync
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
{ inputs, config, nixosConfig, lib, pkgs, mylib, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
inputs,
|
||||||
|
config,
|
||||||
|
nixosConfig,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
mylib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
./audio.nix
|
./audio.nix
|
||||||
./emacs.nix
|
./emacs.nix
|
||||||
|
@ -1,18 +1,20 @@
|
|||||||
# https://nixos.org/manual/nixos/stable/index.html#sec-writing-modules
|
# https://nixos.org/manual/nixos/stable/index.html#sec-writing-modules
|
||||||
|
|
||||||
# This is a function with arguments
|
# This is a function with arguments
|
||||||
{ config, lib, mylib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
# We add stuff from lib to our namespace (mkOption...)
|
# We add stuff from lib to our namespace (mkOption...)
|
||||||
with lib;
|
with lib;
|
||||||
with mylib.modules;
|
with mylib.modules; let
|
||||||
|
|
||||||
let
|
|
||||||
# This is the current state of the option that this module defines
|
# This is the current state of the option that this module defines
|
||||||
# We use it to determine if the config should be changed below
|
# We use it to determine if the config should be changed below
|
||||||
cfg = config.modules.emacs;
|
cfg = config.modules.emacs;
|
||||||
in {
|
in {
|
||||||
imports = [ ];
|
imports = [];
|
||||||
|
|
||||||
# Options is a vector of options this module defines
|
# Options is a vector of options this module defines
|
||||||
# This module defines only the "emacs" option and suboptions "enable" and "doom"
|
# This module defines only the "emacs" option and suboptions "enable" and "doom"
|
||||||
@ -56,15 +58,16 @@ in {
|
|||||||
];
|
];
|
||||||
|
|
||||||
# What home packages should be enabled
|
# What home packages should be enabled
|
||||||
home.packages = with pkgs; builtins.concatLists [
|
home.packages = with pkgs;
|
||||||
(optionals cfg.nativeComp [ ((emacsPackagesFor emacsNativeComp).emacsWithPackages (epkgs: [ epkgs.vterm epkgs.pdf-tools ])) ])
|
builtins.concatLists [
|
||||||
(optionals cfg.pgtkNativeComp [ ((emacsPackagesFor emacsPgtkNativeComp).emacsWithPackages (epkgs: [ epkgs.vterm epkgs.pdf-tools ])) ])
|
(optionals cfg.nativeComp [((emacsPackagesFor emacsNativeComp).emacsWithPackages (epkgs: [epkgs.vterm epkgs.pdf-tools]))])
|
||||||
(optionals cfg.nixpkgs [ ((emacsPackagesFor emacs).emacsWithPackages (epkgs: [ epkgs.vterm epkgs.pdf-tools ])) ])
|
(optionals cfg.pgtkNativeComp [((emacsPackagesFor emacsPgtkNativeComp).emacsWithPackages (epkgs: [epkgs.vterm epkgs.pdf-tools]))])
|
||||||
|
(optionals cfg.nixpkgs [((emacsPackagesFor emacs).emacsWithPackages (epkgs: [epkgs.vterm epkgs.pdf-tools]))])
|
||||||
|
|
||||||
# TODO: Check what hlissner has enabled
|
# TODO: Check what hlissner has enabled
|
||||||
(optionals cfg.doom.enable [
|
(optionals cfg.doom.enable [
|
||||||
# emacs-all-the-icons-fonts # Needs to be in fonts.fonts
|
# emacs-all-the-icons-fonts # Needs to be in fonts.fonts
|
||||||
(ripgrep.override { withPCRE2 = true; })
|
(ripgrep.override {withPCRE2 = true;})
|
||||||
fd
|
fd
|
||||||
zstd
|
zstd
|
||||||
sqlite # Org roam
|
sqlite # Org roam
|
||||||
@ -78,8 +81,11 @@ in {
|
|||||||
# TODO: I don't want to have this here permanently, maybe put in a shell.nix if compilation is needed?
|
# TODO: I don't want to have this here permanently, maybe put in a shell.nix if compilation is needed?
|
||||||
gcc # Need this for org roam
|
gcc # Need this for org roam
|
||||||
|
|
||||||
|
# TODO: Conflicts with global python?
|
||||||
# withPackages expects a function that gets all the packages as argument and returns a list with the packages we want
|
# withPackages expects a function that gets all the packages as argument and returns a list with the packages we want
|
||||||
(python310.withPackages (ppkgs: [ ppkgs.pygments ])) # Latex minted
|
(python310.withPackages (ppkgs: [ppkgs.pygments])) # Latex minted
|
||||||
|
# TODO: Does it work like this aswell?
|
||||||
|
# python310Packages.pygments
|
||||||
|
|
||||||
# nixfmt # This belongs in specific flake.nix
|
# nixfmt # This belongs in specific flake.nix
|
||||||
# shellcheck # This belongs in specific flake.nix
|
# shellcheck # This belongs in specific flake.nix
|
||||||
@ -88,7 +94,7 @@ in {
|
|||||||
])
|
])
|
||||||
];
|
];
|
||||||
|
|
||||||
home.sessionPath = mkIf cfg.doom.enable [ "${config.home.homeDirectory}/.emacs.d/bin" ];
|
home.sessionPath = mkIf cfg.doom.enable ["${config.home.homeDirectory}/.emacs.d/bin"];
|
||||||
|
|
||||||
# Note: Don't do it this way as the config becomes immutable
|
# Note: Don't do it this way as the config becomes immutable
|
||||||
# We tell HomeManager where the config files belong
|
# We tell HomeManager where the config files belong
|
||||||
@ -99,36 +105,36 @@ in {
|
|||||||
# };
|
# };
|
||||||
|
|
||||||
home.activation = mkMerge [
|
home.activation = mkMerge [
|
||||||
|
|
||||||
# The parantheses around mkIf are needed for precedence in this case
|
# The parantheses around mkIf are needed for precedence in this case
|
||||||
(mkIf cfg.doom.enable {
|
(mkIf cfg.doom.enable {
|
||||||
|
|
||||||
# If doom is enabled we want to clone the framework
|
# If doom is enabled we want to clone the framework
|
||||||
# The activation script is being run when home-manager rebuilds
|
# The activation script is being run when home-manager rebuilds
|
||||||
# Because we write to the filesystem, this script has to be run after HomeManager's writeBoundary
|
# Because we write to the filesystem, this script has to be run after HomeManager's writeBoundary
|
||||||
installDoomEmacs = hm.dag.entryAfter [ "writeBoundary" ] ''
|
installDoomEmacs = hm.dag.entryAfter ["writeBoundary"] ''
|
||||||
if [ ! -d "${config.home.homeDirectory}/.emacs.d" ]; then
|
if [ ! -d "${config.home.homeDirectory}/.emacs.d" ]; then
|
||||||
git clone --depth=1 --single-branch "https://github.com/doomemacs/doomemacs" "${config.home.homeDirectory}/.emacs.d"
|
git clone --depth=1 --single-branch "https://github.com/doomemacs/doomemacs" "${config.home.homeDirectory}/.emacs.d"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# With this approach we keep the config mutable as it is not copied and linked from store
|
# With this approach we keep the config mutable as it is not copied and linked from store
|
||||||
linkDoomConfig = hm.dag.entryAfter [ "writeBoundary" "installDoomEmacs" ]
|
linkDoomConfig =
|
||||||
|
hm.dag.entryAfter ["writeBoundary" "installDoomEmacs"]
|
||||||
(mkLink "${config.home.homeDirectory}/NixFlake/config/doom" "${config.home.homeDirectory}/.config/doom");
|
(mkLink "${config.home.homeDirectory}/NixFlake/config/doom" "${config.home.homeDirectory}/.config/doom");
|
||||||
})
|
})
|
||||||
(mkElse cfg.doom.enable {
|
(mkElse cfg.doom.enable {
|
||||||
unlinkDoomConfig = hm.dag.entryAfter [ "writeBoundary" "installDoomEmacs" ]
|
unlinkDoomConfig =
|
||||||
|
hm.dag.entryAfter ["writeBoundary" "installDoomEmacs"]
|
||||||
(mkUnlink "${config.home.homeDirectory}/.config/doom");
|
(mkUnlink "${config.home.homeDirectory}/.config/doom");
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf (cfg.doom.enable && cfg.doom.autoSync) {
|
(mkIf (cfg.doom.enable && cfg.doom.autoSync) {
|
||||||
syncDoomEmacs = hm.dag.entryAfter [ "writeBoundary" "linkDoomConfig" ] ''
|
syncDoomEmacs = hm.dag.entryAfter ["writeBoundary" "linkDoomConfig"] ''
|
||||||
${config.home.homeDirectory}/.emacs.d/bin/doom sync &
|
${config.home.homeDirectory}/.emacs.d/bin/doom sync &
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf (cfg.doom.enable && cfg.doom.autoUpgrade) {
|
(mkIf (cfg.doom.enable && cfg.doom.autoUpgrade) {
|
||||||
upgradeDoomEmacs = hm.dag.entryAfter [ "writeBoundary" "linkDoomConfig" ] ''
|
upgradeDoomEmacs = hm.dag.entryAfter ["writeBoundary" "linkDoomConfig"] ''
|
||||||
${config.home.homeDirectory}/.emacs.d/bin/doom upgrade -!
|
${config.home.homeDirectory}/.emacs.d/bin/doom upgrade -!
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
@ -1,18 +1,19 @@
|
|||||||
# Example: https://beb.ninja/post/email/
|
# Example: https://beb.ninja/post/email/
|
||||||
# Example: https://sbr.pm/configurations/mails.html
|
# Example: https://sbr.pm/configurations/mails.html
|
||||||
# NOTE: The passwords must exist in kwallet
|
# NOTE: The passwords must exist in kwallet
|
||||||
|
|
||||||
# TODO: Emacs mail config
|
# TODO: Emacs mail config
|
||||||
|
{
|
||||||
{ config, nixosConfig, lib, mylib, pkgs, ... }:
|
config,
|
||||||
|
nixosConfig,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
with mylib.modules;
|
with mylib.modules; let
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.email;
|
cfg = config.modules.email;
|
||||||
in {
|
in {
|
||||||
|
|
||||||
options.modules.email = {
|
options.modules.email = {
|
||||||
enable = mkEnableOpt "Email";
|
enable = mkEnableOpt "Email";
|
||||||
autosync = mkEnableOpt "Automatically call \"notmuch new\" via systemd timer";
|
autosync = mkEnableOpt "Automatically call \"notmuch new\" via systemd timer";
|
||||||
@ -26,8 +27,9 @@ in {
|
|||||||
|
|
||||||
# TODO: Add Maildir to nextcloud sync
|
# TODO: Add Maildir to nextcloud sync
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = with pkgs; builtins.concatLists [
|
home.packages = with pkgs;
|
||||||
(optionals cfg.kmail.enable [ kmail ])
|
builtins.concatLists [
|
||||||
|
(optionals cfg.kmail.enable [kmail])
|
||||||
];
|
];
|
||||||
|
|
||||||
home.file = mkMerge [
|
home.file = mkMerge [
|
||||||
@ -54,7 +56,7 @@ in {
|
|||||||
|
|
||||||
# Autosync, don't need imapnotify when enabled
|
# Autosync, don't need imapnotify when enabled
|
||||||
systemd.user.services.mail-autosync = (mkIf cfg.autosync) {
|
systemd.user.services.mail-autosync = (mkIf cfg.autosync) {
|
||||||
Unit = { Description = "Automatic notmuch/mbsync synchronization"; };
|
Unit = {Description = "Automatic notmuch/mbsync synchronization";};
|
||||||
Service = {
|
Service = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
# ExecStart = "${pkgs.isync}/bin/mbsync -a";
|
# ExecStart = "${pkgs.isync}/bin/mbsync -a";
|
||||||
@ -62,12 +64,12 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
systemd.user.timers.mail-autosync = (mkIf cfg.autosync) {
|
systemd.user.timers.mail-autosync = (mkIf cfg.autosync) {
|
||||||
Unit = { Description = "Automatic notmuch/mbsync synchronization"; };
|
Unit = {Description = "Automatic notmuch/mbsync synchronization";};
|
||||||
Timer = {
|
Timer = {
|
||||||
OnBootSec = "30";
|
OnBootSec = "30";
|
||||||
OnUnitActiveSec = "5m";
|
OnUnitActiveSec = "5m";
|
||||||
};
|
};
|
||||||
Install = { WantedBy = [ "timers.target" ]; };
|
Install = {WantedBy = ["timers.target"];};
|
||||||
};
|
};
|
||||||
|
|
||||||
accounts.email.accounts = {
|
accounts.email.accounts = {
|
||||||
@ -84,7 +86,8 @@ in {
|
|||||||
|
|
||||||
passwordCommand = "kwallet-query -f email -r urpost kdewallet";
|
passwordCommand = "kwallet-query -f email -r urpost kdewallet";
|
||||||
|
|
||||||
mbsync = { # Imap
|
mbsync = {
|
||||||
|
# Imap
|
||||||
enable = true;
|
enable = true;
|
||||||
create = "maildir";
|
create = "maildir";
|
||||||
};
|
};
|
||||||
@ -111,7 +114,8 @@ in {
|
|||||||
|
|
||||||
passwordCommand = "kwallet-query -f email -r hhu kdewallet";
|
passwordCommand = "kwallet-query -f email -r hhu kdewallet";
|
||||||
|
|
||||||
mbsync = { # Imap
|
mbsync = {
|
||||||
|
# Imap
|
||||||
enable = true;
|
enable = true;
|
||||||
create = "maildir";
|
create = "maildir";
|
||||||
};
|
};
|
||||||
@ -137,7 +141,8 @@ in {
|
|||||||
# NOTE: Uses Gmail app password
|
# NOTE: Uses Gmail app password
|
||||||
passwordCommand = "kwallet-query -f email -r gmail kdewallet";
|
passwordCommand = "kwallet-query -f email -r gmail kdewallet";
|
||||||
|
|
||||||
mbsync = { # Imap
|
mbsync = {
|
||||||
|
# Imap
|
||||||
enable = true;
|
enable = true;
|
||||||
create = "maildir";
|
create = "maildir";
|
||||||
patterns = ["*" "![Gmail]*" "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail"]; # Only sync inbox
|
patterns = ["*" "![Gmail]*" "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail"]; # Only sync inbox
|
||||||
|
@ -1,14 +1,17 @@
|
|||||||
# TODO: https://github.com/nix-community/home-manager/commit/69d19b9839638fc487b370e0600a03577a559081
|
# TODO: https://github.com/nix-community/home-manager/commit/69d19b9839638fc487b370e0600a03577a559081
|
||||||
|
{
|
||||||
{ inputs, config, nixosConfig, lib, mylib, pkgs, ... }:
|
inputs,
|
||||||
|
config,
|
||||||
|
nixosConfig,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
with mylib.modules;
|
with mylib.modules; let
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.firefox;
|
cfg = config.modules.firefox;
|
||||||
in {
|
in {
|
||||||
|
|
||||||
options.modules.firefox = {
|
options.modules.firefox = {
|
||||||
enable = mkEnableOpt "Firefox";
|
enable = mkEnableOpt "Firefox";
|
||||||
wayland = mkBoolOpt false "Enable firefox wayland support";
|
wayland = mkBoolOpt false "Enable firefox wayland support";
|
||||||
@ -19,7 +22,8 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = with pkgs; builtins.concatLists [
|
home.packages = with pkgs;
|
||||||
|
builtins.concatLists [
|
||||||
# TODO: I don't think vaapi works yet
|
# TODO: I don't think vaapi works yet
|
||||||
(optionals cfg.vaapi [
|
(optionals cfg.vaapi [
|
||||||
# NOTE: I put these into hardware.opengl.extrapackages, don't know if they belong there...
|
# NOTE: I put these into hardware.opengl.extrapackages, don't know if they belong there...
|
||||||
@ -27,7 +31,7 @@ in {
|
|||||||
# libvdpau
|
# libvdpau
|
||||||
])
|
])
|
||||||
|
|
||||||
(optionals cfg.gnomeTheme [ firefox-gnome-theme ])
|
(optionals cfg.gnomeTheme [firefox-gnome-theme])
|
||||||
];
|
];
|
||||||
|
|
||||||
home.sessionVariables = mkMerge [
|
home.sessionVariables = mkMerge [
|
||||||
@ -52,7 +56,7 @@ in {
|
|||||||
icon = "firefox";
|
icon = "firefox";
|
||||||
exec = "firefox --private-window %U";
|
exec = "firefox --private-window %U";
|
||||||
terminal = false;
|
terminal = false;
|
||||||
categories = [ "Network" "WebBrowser" ];
|
categories = ["Network" "WebBrowser"];
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.firefox = {
|
programs.firefox = {
|
||||||
@ -72,7 +76,7 @@ in {
|
|||||||
# not strictly necessary
|
# not strictly necessary
|
||||||
extraPolicies = {
|
extraPolicies = {
|
||||||
# TODO: Make library function to allow easy bookmark creation and add my default bookmarks/folders
|
# TODO: Make library function to allow easy bookmark creation and add my default bookmarks/folders
|
||||||
Bookmarks = (optionalAttrs cfg.defaultBookmarks { });
|
Bookmarks = optionalAttrs cfg.defaultBookmarks {};
|
||||||
CaptivePortal = false;
|
CaptivePortal = false;
|
||||||
DisableFirefoxAccounts = true;
|
DisableFirefoxAccounts = true;
|
||||||
DisableFirefoxStudies = true;
|
DisableFirefoxStudies = true;
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
{ config, nixosConfig, lib, mylib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
nixosConfig,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
with mylib.modules;
|
with mylib.modules; let
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.fish;
|
cfg = config.modules.fish;
|
||||||
in {
|
in {
|
||||||
|
|
||||||
options.modules.fish = {
|
options.modules.fish = {
|
||||||
enable = mkEnableOpt "Fish";
|
enable = mkEnableOpt "Fish";
|
||||||
};
|
};
|
||||||
@ -31,7 +34,8 @@ in {
|
|||||||
hasHomePackage = package: (contains config.home.packages package);
|
hasHomePackage = package: (contains config.home.packages package);
|
||||||
# Only add fish abbr if package is installed
|
# Only add fish abbr if package is installed
|
||||||
abbrify = package: abbr: (optionalAttrs (hasHomePackage package) abbr);
|
abbrify = package: abbr: (optionalAttrs (hasHomePackage package) abbr);
|
||||||
in mkMerge [
|
in
|
||||||
|
mkMerge [
|
||||||
# Default abbrs, always available
|
# Default abbrs, always available
|
||||||
{
|
{
|
||||||
# Shell basic
|
# Shell basic
|
||||||
@ -61,7 +65,7 @@ in {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Abbrs only available if package is installed
|
# Abbrs only available if package is installed
|
||||||
(abbrify pkgs.btop { top = "btop"; })
|
(abbrify pkgs.btop {top = "btop";})
|
||||||
(abbrify pkgs.duf {
|
(abbrify pkgs.duf {
|
||||||
df = "duf";
|
df = "duf";
|
||||||
disksummary = "duf";
|
disksummary = "duf";
|
||||||
@ -72,8 +76,8 @@ in {
|
|||||||
lsa = "exa --color always --group-directories-first -F -l -a --git --icons";
|
lsa = "exa --color always --group-directories-first -F -l -a --git --icons";
|
||||||
tre = "exa --color always --group-directories-first -F -T -L 2 ---icons";
|
tre = "exa --color always --group-directories-first -F -T -L 2 ---icons";
|
||||||
})
|
})
|
||||||
(abbrify pkgs.fd { find = "fd"; })
|
(abbrify pkgs.fd {find = "fd";})
|
||||||
(abbrify pkgs.fzf { fuzzy = "fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}'"; })
|
(abbrify pkgs.fzf {fuzzy = "fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}'";})
|
||||||
(abbrify pkgs.gdu {
|
(abbrify pkgs.gdu {
|
||||||
du = "gdu";
|
du = "gdu";
|
||||||
storageanalysis = "gdu";
|
storageanalysis = "gdu";
|
||||||
@ -85,9 +89,9 @@ in {
|
|||||||
glg = "git log --graph --decorate --oneline";
|
glg = "git log --graph --decorate --oneline";
|
||||||
gcl = "git clone";
|
gcl = "git clone";
|
||||||
})
|
})
|
||||||
(abbrify pkgs.gping { ping = "gping"; })
|
(abbrify pkgs.gping {ping = "gping";})
|
||||||
(abbrify pkgs.lazygit { lg = "lazygit"; })
|
(abbrify pkgs.lazygit {lg = "lazygit";})
|
||||||
(abbrify pkgs.navi { n = "navi"; })
|
(abbrify pkgs.navi {n = "navi";})
|
||||||
(abbrify pkgs.notmuch {
|
(abbrify pkgs.notmuch {
|
||||||
mailrefresh = "notmuch new";
|
mailrefresh = "notmuch new";
|
||||||
mailsearch = "notmuch search";
|
mailsearch = "notmuch search";
|
||||||
@ -101,12 +105,12 @@ in {
|
|||||||
vpnkr = "protonvpn-cli c --cc kr";
|
vpnkr = "protonvpn-cli c --cc kr";
|
||||||
vpnoff = "protonvpn-cli d";
|
vpnoff = "protonvpn-cli d";
|
||||||
})
|
})
|
||||||
(abbrify pkgs.ranger { r = "ranger --choosedir=$HOME/.rangerdir; set LASTDIR (cat $HOME/.rangerdir); cd $LASTDIR"; })
|
(abbrify pkgs.ranger {r = "ranger --choosedir=$HOME/.rangerdir; set LASTDIR (cat $HOME/.rangerdir); cd $LASTDIR";})
|
||||||
(abbrify pkgs.rsync {
|
(abbrify pkgs.rsync {
|
||||||
cp = "rsync -ahv --inplace --partial --info=progress2";
|
cp = "rsync -ahv --inplace --partial --info=progress2";
|
||||||
rsync = "rsync -ahv --inplace --partial --info=progress2";
|
rsync = "rsync -ahv --inplace --partial --info=progress2";
|
||||||
})
|
})
|
||||||
(abbrify pkgs.sd { sed = "sd"; })
|
(abbrify pkgs.sd {sed = "sd";})
|
||||||
(abbrify pkgs.yt-dlp {
|
(abbrify pkgs.yt-dlp {
|
||||||
mp4 = "yt-dlp -f 'bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b' --recode-video mp4"; # the -f options are yt-dlp defaults
|
mp4 = "yt-dlp -f 'bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b' --recode-video mp4"; # the -f options are yt-dlp defaults
|
||||||
mp3 = "yt-dlp -f 'ba' --extract-audio --audio-format mp3";
|
mp3 = "yt-dlp -f 'ba' --extract-audio --audio-format mp3";
|
||||||
|
@ -1,15 +1,19 @@
|
|||||||
{ config, nixosConfig, lib, mylib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
nixosConfig,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
with mylib.modules;
|
with mylib.modules;
|
||||||
|
|
||||||
# NOTE: The module is also used by other modules (gaming, audio).
|
# NOTE: The module is also used by other modules (gaming, audio).
|
||||||
# It is important that every flatpak interaction is handled through this module
|
# It is important that every flatpak interaction is handled through this module
|
||||||
# to prevent that anything is removed by a module although it is required by another one
|
# to prevent that anything is removed by a module although it is required by another one
|
||||||
|
let
|
||||||
let
|
|
||||||
cfg = config.modules.flatpak;
|
cfg = config.modules.flatpak;
|
||||||
in {
|
in {
|
||||||
options.modules.flatpak = {
|
options.modules.flatpak = {
|
||||||
enable = mkEnableOpt "Flatpak module";
|
enable = mkEnableOpt "Flatpak module";
|
||||||
fontFix = mkBoolOpt true "Link fonts to ~/.local/share/fonts so flatpak apps can find them";
|
fontFix = mkBoolOpt true "Link fonts to ~/.local/share/fonts so flatpak apps can find them";
|
||||||
@ -28,30 +32,30 @@ in {
|
|||||||
# This is mainly used by other modules to allow them to use flatpak packages
|
# This is mainly used by other modules to allow them to use flatpak packages
|
||||||
extraInstall = mkOption {
|
extraInstall = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
default = [ ];
|
default = [];
|
||||||
description = "Flatpaks that will be installed additionally";
|
description = "Flatpaks that will be installed additionally";
|
||||||
};
|
};
|
||||||
|
|
||||||
# This doesn't uninstall if any flatpak is still present in the extraInstall list
|
# This doesn't uninstall if any flatpak is still present in the extraInstall list
|
||||||
extraRemove = mkOption {
|
extraRemove = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
default = [ ];
|
default = [];
|
||||||
description = "Flatpaks that will be removed additionally (use with extraInstall)";
|
description = "Flatpaks that will be removed additionally (use with extraInstall)";
|
||||||
};
|
};
|
||||||
|
|
||||||
extraOverride = mkOption {
|
extraOverride = mkOption {
|
||||||
type = types.listOf types.attrs;
|
type = types.listOf types.attrs;
|
||||||
default = [ ];
|
default = [];
|
||||||
# TODO: Change the format to { "com.usebottles.bottles" = [ "~/Documents" "~/Downloads" ]; }
|
# TODO: Change the format to { "com.usebottles.bottles" = [ "~/Documents" "~/Downloads" ]; }
|
||||||
# TODO: This requires that the lists of the same key are being merged recursively, mkMerge would override the key
|
# TODO: This requires that the lists of the same key are being merged recursively, mkMerge would override the key
|
||||||
example = [ { "com.usebottles.bottles" = "\${config.home.homeDirectory}/Documents"; } ];
|
example = [{"com.usebottles.bottles" = "\${config.home.homeDirectory}/Documents";}];
|
||||||
description = "Additional overrides";
|
description = "Additional overrides";
|
||||||
};
|
};
|
||||||
|
|
||||||
extraGlobalOverride = mkOption {
|
extraGlobalOverride = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
default = [ ];
|
default = [];
|
||||||
example = [ "\${config.home.homeDirectory}/Documents:ro" ];
|
example = ["\${config.home.homeDirectory}/Documents:ro"];
|
||||||
description = "Additional global overrides";
|
description = "Additional global overrides";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -74,13 +78,11 @@ in {
|
|||||||
# TODO: Also only filesystem overrides are applied
|
# TODO: Also only filesystem overrides are applied
|
||||||
home.file = let
|
home.file = let
|
||||||
# Specific overrides
|
# Specific overrides
|
||||||
|
|
||||||
# This generates the set { "<filename>" = "<overrides>"; }
|
# This generates the set { "<filename>" = "<overrides>"; }
|
||||||
concat_override = name: value:
|
concat_override = name: value: (optionalAttrs (name != null) {".local/share/flatpak/overrides/${name}".text = "[Context]\nfilesystems=${value}";});
|
||||||
(optionalAttrs (name != null) { ".local/share/flatpak/overrides/${name}".text = "[Context]\nfilesystems=${value}"; });
|
|
||||||
|
|
||||||
# This is a list of sets: [ { "<filename>" = "<overrides>"; } { "<filename>" = "<overrides>"; } ]
|
# This is a list of sets: [ { "<filename>" = "<overrides>"; } { "<filename>" = "<overrides>"; } ]
|
||||||
extra_overrides = (map (set: concat_override (attrName set) (attrValue set)) cfg.extraOverride);
|
extra_overrides = map (set: concat_override (attrName set) (attrValue set)) cfg.extraOverride;
|
||||||
|
|
||||||
# Global overrides
|
# Global overrides
|
||||||
|
|
||||||
@ -100,35 +102,41 @@ in {
|
|||||||
# "/run/current-system/sw/share/icons:ro"
|
# "/run/current-system/sw/share/icons:ro"
|
||||||
];
|
];
|
||||||
|
|
||||||
global_overrides = builtins.concatLists [ global_default_overrides cfg.extraGlobalOverride ];
|
global_overrides = builtins.concatLists [global_default_overrides cfg.extraGlobalOverride];
|
||||||
|
|
||||||
str_global_overrides = builtins.concatStringsSep ";" global_overrides;
|
str_global_overrides = builtins.concatStringsSep ";" global_overrides;
|
||||||
in mkMerge ([
|
in
|
||||||
|
mkMerge ([
|
||||||
{
|
{
|
||||||
".local/share/flatpak/overrides/global".text = "[Context]\nfilesystems=${str_global_overrides}";
|
".local/share/flatpak/overrides/global".text = "[Context]\nfilesystems=${str_global_overrides}";
|
||||||
}
|
}
|
||||||
] ++ extra_overrides);
|
]
|
||||||
|
++ extra_overrides);
|
||||||
|
|
||||||
home.activation = mkMerge [
|
home.activation = mkMerge [
|
||||||
# We link like this to be able to address the absolute location, also the fonts won't get copied to store
|
# We link like this to be able to address the absolute location, also the fonts won't get copied to store
|
||||||
# NOTE: This path contains all the fonts because fonts.fontDir.enable is true
|
# NOTE: This path contains all the fonts because fonts.fontDir.enable is true
|
||||||
(mkIf cfg.fontFix {
|
(mkIf cfg.fontFix {
|
||||||
linkFontDir = lib.hm.dag.entryAfter [ "writeBoundary" ]
|
linkFontDir =
|
||||||
|
lib.hm.dag.entryAfter ["writeBoundary"]
|
||||||
(mkLink "/run/current-system/sw/share/X11/fonts" "${config.home.homeDirectory}/.local/share/fonts");
|
(mkLink "/run/current-system/sw/share/X11/fonts" "${config.home.homeDirectory}/.local/share/fonts");
|
||||||
})
|
})
|
||||||
(mkElse cfg.fontFix {
|
(mkElse cfg.fontFix {
|
||||||
unlinkFontDir = lib.hm.dag.entryAfter [ "writeBoundary" ]
|
unlinkFontDir =
|
||||||
|
lib.hm.dag.entryAfter ["writeBoundary"]
|
||||||
(mkUnlink "${config.home.homeDirectory}/.local/share/fonts");
|
(mkUnlink "${config.home.homeDirectory}/.local/share/fonts");
|
||||||
})
|
})
|
||||||
|
|
||||||
# Fixes missing icons + cursor
|
# Fixes missing icons + cursor
|
||||||
# NOTE: This path works because we have homeManager.useUserPackages = true (everything is stored in /etc/profiles/)
|
# NOTE: This path works because we have homeManager.useUserPackages = true (everything is stored in /etc/profiles/)
|
||||||
(mkIf cfg.iconFix {
|
(mkIf cfg.iconFix {
|
||||||
linkIconDir = lib.hm.dag.entryAfter [ "writeBoundary" ]
|
linkIconDir =
|
||||||
|
lib.hm.dag.entryAfter ["writeBoundary"]
|
||||||
(mkLink "/etc/profiles/per-user/christoph/share/icons" "${config.home.homeDirectory}/.local/share/icons");
|
(mkLink "/etc/profiles/per-user/christoph/share/icons" "${config.home.homeDirectory}/.local/share/icons");
|
||||||
})
|
})
|
||||||
(mkElse cfg.iconFix {
|
(mkElse cfg.iconFix {
|
||||||
unlinkIconDir = lib.hm.dag.entryAfter [ "writeBoundary" ]
|
unlinkIconDir =
|
||||||
|
lib.hm.dag.entryAfter ["writeBoundary"]
|
||||||
(mkUnlink "${config.home.homeDirectory}/.local/share/icons");
|
(mkUnlink "${config.home.homeDirectory}/.local/share/icons");
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -137,17 +145,17 @@ in {
|
|||||||
# TODO: Enable this block only if any flatpak is enabled
|
# TODO: Enable this block only if any flatpak is enabled
|
||||||
installFlatpaks = let
|
installFlatpaks = let
|
||||||
to_install = builtins.concatLists [
|
to_install = builtins.concatLists [
|
||||||
(optionals cfg.discord.enable [ "com.discordapp.Discord" ])
|
(optionals cfg.discord.enable ["com.discordapp.Discord"])
|
||||||
(optionals cfg.spotify.enable [ "com.spotify.Client" ])
|
(optionals cfg.spotify.enable ["com.spotify.Client"])
|
||||||
(optionals cfg.flatseal.enable [ "com.github.tchx84.Flatseal" ])
|
(optionals cfg.flatseal.enable ["com.github.tchx84.Flatseal"])
|
||||||
(optionals cfg.bottles.enable [ "com.usebottles.bottles" ])
|
(optionals cfg.bottles.enable ["com.usebottles.bottles"])
|
||||||
cfg.extraInstall
|
cfg.extraInstall
|
||||||
];
|
];
|
||||||
|
|
||||||
to_install_str = builtins.concatStringsSep " " to_install;
|
to_install_str = builtins.concatStringsSep " " to_install;
|
||||||
in
|
in
|
||||||
# Flatpak install can take a long time so we disconnect the process to not trigger the HM timeout (90s)
|
# Flatpak install can take a long time so we disconnect the process to not trigger the HM timeout (90s)
|
||||||
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||||
sudo flatpak install -y ${to_install_str} &
|
sudo flatpak install -y ${to_install_str} &
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
@ -156,10 +164,10 @@ in {
|
|||||||
# TODO: Enable this block only if any flatpak is disabled
|
# TODO: Enable this block only if any flatpak is disabled
|
||||||
removeFlatpaks = let
|
removeFlatpaks = let
|
||||||
to_remove = builtins.concatLists [
|
to_remove = builtins.concatLists [
|
||||||
(optionals (!cfg.discord.enable) [ "com.discordapp.Discord" ])
|
(optionals (!cfg.discord.enable) ["com.discordapp.Discord"])
|
||||||
(optionals (!cfg.spotify.enable) [ "com.spotify.Client" ])
|
(optionals (!cfg.spotify.enable) ["com.spotify.Client"])
|
||||||
(optionals (!cfg.flatseal.enable) [ "com.github.tchx84.Flatseal" ])
|
(optionals (!cfg.flatseal.enable) ["com.github.tchx84.Flatseal"])
|
||||||
(optionals (!cfg.bottles.enable) [ "com.usebottles.bottles" ])
|
(optionals (!cfg.bottles.enable) ["com.usebottles.bottles"])
|
||||||
# Remove only the flatpaks that are not present in extraInstall
|
# Remove only the flatpaks that are not present in extraInstall
|
||||||
(without cfg.extraRemove cfg.extraInstall)
|
(without cfg.extraRemove cfg.extraInstall)
|
||||||
];
|
];
|
||||||
@ -168,24 +176,24 @@ in {
|
|||||||
in
|
in
|
||||||
# By using || we make sure this command never throws any errors
|
# By using || we make sure this command never throws any errors
|
||||||
# Uninstallation is fast so HM timeout shouldn't be triggered
|
# Uninstallation is fast so HM timeout shouldn't be triggered
|
||||||
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||||
sudo flatpak uninstall -y ${to_remove_str} || echo "Nothing to be removed"
|
sudo flatpak uninstall -y ${to_remove_str} || echo "Nothing to be removed"
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
(mkIf cfg.autoUpdate {
|
(mkIf cfg.autoUpdate {
|
||||||
# Flatpak install can take a long time so we disconnect the process to not trigger the HM timeout (90s)
|
# Flatpak install can take a long time so we disconnect the process to not trigger the HM timeout (90s)
|
||||||
updateFlatpak = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
updateFlatpak = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||||
sudo flatpak update -y &
|
sudo flatpak update -y &
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
||||||
# Execute this after flatpak removal as there can be leftovers
|
# Execute this after flatpak removal as there can be leftovers
|
||||||
(mkIf cfg.autoPrune {
|
(mkIf cfg.autoPrune {
|
||||||
pruneFlatpak = lib.hm.dag.entryAfter [ "writeBoundary" "removeFlatpak" ] ''
|
pruneFlatpak = lib.hm.dag.entryAfter ["writeBoundary" "removeFlatpak"] ''
|
||||||
sudo flatpak uninstall --unused -y
|
sudo flatpak uninstall --unused -y
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
{ config, lib, mylib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
with mylib.modules;
|
with mylib.modules; let
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.gaming;
|
cfg = config.modules.gaming;
|
||||||
cfgfp = config.modules.flatpak;
|
cfgfp = config.modules.flatpak;
|
||||||
in {
|
in {
|
||||||
@ -50,7 +53,8 @@ in {
|
|||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
home.packages = with pkgs; builtins.concatLists [
|
home.packages = with pkgs;
|
||||||
|
builtins.concatLists [
|
||||||
[
|
[
|
||||||
gamemode # gamemode should be always enabled (could also be enabled by audio module)
|
gamemode # gamemode should be always enabled (could also be enabled by audio module)
|
||||||
oversteer # TODO: Make option
|
oversteer # TODO: Make option
|
||||||
@ -59,16 +63,16 @@ in {
|
|||||||
]
|
]
|
||||||
|
|
||||||
# TODO: Extra config (extensions etc) in chromium module
|
# TODO: Extra config (extensions etc) in chromium module
|
||||||
(optionals cfg.discordChromium.enable [ chromium ])
|
(optionals cfg.discordChromium.enable [chromium])
|
||||||
|
|
||||||
# Prefer flatpak version as nixpkgs version isn't always updated in time
|
# Prefer flatpak version as nixpkgs version isn't always updated in time
|
||||||
(optionals cfg.discordElectron.enable [ discord ])
|
(optionals cfg.discordElectron.enable [discord])
|
||||||
(optionals cfg.steam.adwaita [ adwaita-for-steam ])
|
(optionals cfg.steam.adwaita [adwaita-for-steam])
|
||||||
|
|
||||||
# Prefer flatpak version as this one doesn't find the STEAM_DIR automatically
|
# Prefer flatpak version as this one doesn't find the STEAM_DIR automatically
|
||||||
# (optionals cfg.steam.enable [ protontricks ])
|
# (optionals cfg.steam.enable [ protontricks ])
|
||||||
|
|
||||||
(optionals cfg.dwarffortress.enable [ dwarf-fortress-packages.dwarf-fortress-full ])
|
(optionals cfg.dwarffortress.enable [dwarf-fortress-packages.dwarf-fortress-full])
|
||||||
];
|
];
|
||||||
|
|
||||||
# This doesn't work because steam doesn't detect symlinked skins, files have to be copied
|
# This doesn't work because steam doesn't detect symlinked skins, files have to be copied
|
||||||
@ -84,7 +88,7 @@ in {
|
|||||||
# ];
|
# ];
|
||||||
home.activation = mkMerge [
|
home.activation = mkMerge [
|
||||||
(optionalAttrs cfg.steam.adwaita {
|
(optionalAttrs cfg.steam.adwaita {
|
||||||
copySteamAdwaitaSkin = hm.dag.entryAfter [ "writeBoundary" ] ''
|
copySteamAdwaitaSkin = hm.dag.entryAfter ["writeBoundary"] ''
|
||||||
if [ ! -d ${config.home.homeDirectory}/.var/app/com.valvesoftware.Steam/.local/share/Steam/skins ]; then
|
if [ ! -d ${config.home.homeDirectory}/.var/app/com.valvesoftware.Steam/.local/share/Steam/skins ]; then
|
||||||
mkdir ${config.home.homeDirectory}/.var/app/com.valvesoftware.Steam/.local/share/Steam/skins
|
mkdir ${config.home.homeDirectory}/.var/app/com.valvesoftware.Steam/.local/share/Steam/skins
|
||||||
fi
|
fi
|
||||||
@ -100,7 +104,7 @@ in {
|
|||||||
})
|
})
|
||||||
|
|
||||||
(optionalAttrs (! cfg.steam.adwaita) {
|
(optionalAttrs (! cfg.steam.adwaita) {
|
||||||
deleteSteamAdwaitaSkin = hm.dag.entryAfter [ "writeBoundary" ] ''
|
deleteSteamAdwaitaSkin = hm.dag.entryAfter ["writeBoundary"] ''
|
||||||
rm -rf ${config.home.homeDirectory}/.var/app/com.valvesoftware.Steam/.local/share/Steam/skins/Adwaita
|
rm -rf ${config.home.homeDirectory}/.var/app/com.valvesoftware.Steam/.local/share/Steam/skins/Adwaita
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
@ -112,7 +116,7 @@ in {
|
|||||||
icon = "discord";
|
icon = "discord";
|
||||||
exec = "chromium --new-window discord.com/app";
|
exec = "chromium --new-window discord.com/app";
|
||||||
terminal = false;
|
terminal = false;
|
||||||
categories = [ "Network" "Chat" ];
|
categories = ["Network" "Chat"];
|
||||||
};
|
};
|
||||||
|
|
||||||
# NOTE: Important to not disable this option if another module enables it
|
# NOTE: Important to not disable this option if another module enables it
|
||||||
@ -152,8 +156,8 @@ in {
|
|||||||
# "com.valvesoftware.Steam.CompatibilityTool.Proton-GE"
|
# "com.valvesoftware.Steam.CompatibilityTool.Proton-GE"
|
||||||
"net.davidotek.pupgui2"
|
"net.davidotek.pupgui2"
|
||||||
])
|
])
|
||||||
(optionals (cfg.steam.enable && cfg.steam.gamescope) [ "com.valvesoftware.Steam.Utility.gamescope" ])
|
(optionals (cfg.steam.enable && cfg.steam.gamescope) ["com.valvesoftware.Steam.Utility.gamescope"])
|
||||||
(optionals cfg.prism.enable [ "org.prismlauncher.PrismLauncher" ])
|
(optionals cfg.prism.enable ["org.prismlauncher.PrismLauncher"])
|
||||||
];
|
];
|
||||||
|
|
||||||
modules.flatpak.extraRemove = builtins.concatLists [
|
modules.flatpak.extraRemove = builtins.concatLists [
|
||||||
@ -168,8 +172,8 @@ in {
|
|||||||
# "com.valvesoftware.Steam.CompatibilityTool.Proton-GE"
|
# "com.valvesoftware.Steam.CompatibilityTool.Proton-GE"
|
||||||
"net.davidotek.pupgui2"
|
"net.davidotek.pupgui2"
|
||||||
])
|
])
|
||||||
(optionals (!cfg.steam.enable || !cfg.steam.gamescope) [ "com.valvesoftware.Steam.Utility.gamescope" ])
|
(optionals (!cfg.steam.enable || !cfg.steam.gamescope) ["com.valvesoftware.Steam.Utility.gamescope"])
|
||||||
(optionals (!cfg.prism.enable) [ "org.prismlauncher.PrismLauncher" ])
|
(optionals (!cfg.prism.enable) ["org.prismlauncher.PrismLauncher"])
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
{ config, nixosConfig, lib, mylib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
nixosConfig,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
with mylib.modules;
|
with mylib.modules; let
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.gnome;
|
cfg = config.modules.gnome;
|
||||||
in {
|
in {
|
||||||
|
|
||||||
options.modules.gnome = {
|
options.modules.gnome = {
|
||||||
enable = mkEnableOpt "Gnome Desktop";
|
enable = mkEnableOpt "Gnome Desktop";
|
||||||
# TODO: Add option for dash-to-dock
|
# TODO: Add option for dash-to-dock
|
||||||
@ -40,7 +43,7 @@ in {
|
|||||||
];
|
];
|
||||||
|
|
||||||
gtk = mkMerge [
|
gtk = mkMerge [
|
||||||
{ enable = true; }
|
{enable = true;}
|
||||||
|
|
||||||
(optionalAttrs cfg.theme.papirusIcons {
|
(optionalAttrs cfg.theme.papirusIcons {
|
||||||
iconTheme.package = pkgs.papirus-icon-theme;
|
iconTheme.package = pkgs.papirus-icon-theme;
|
||||||
@ -60,7 +63,8 @@ in {
|
|||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
home.packages = with pkgs; builtins.concatLists [
|
home.packages = with pkgs;
|
||||||
|
builtins.concatLists [
|
||||||
[
|
[
|
||||||
# gnome.gnome-session # Allow to start gnome from tty (sadly this is not usable, many things don't work)
|
# gnome.gnome-session # Allow to start gnome from tty (sadly this is not usable, many things don't work)
|
||||||
gnome.gnome-boxes # VM
|
gnome.gnome-boxes # VM
|
||||||
@ -216,7 +220,7 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
"org/gnome/nautilus/icon-view" = {
|
"org/gnome/nautilus/icon-view" = {
|
||||||
captions = [ "size" "date_modified" "none" ];
|
captions = ["size" "date_modified" "none"];
|
||||||
default-zoom-level = "larger";
|
default-zoom-level = "larger";
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -254,7 +258,8 @@ in {
|
|||||||
"drive-menu@gnome-shell-extensions.gcampax.github.com"
|
"drive-menu@gnome-shell-extensions.gcampax.github.com"
|
||||||
"user-theme@gnome-shell-extensions.gcampax.github.com"
|
"user-theme@gnome-shell-extensions.gcampax.github.com"
|
||||||
];
|
];
|
||||||
enabled-extensions = with pkgs; builtins.concatLists [
|
enabled-extensions = with pkgs;
|
||||||
|
builtins.concatLists [
|
||||||
[
|
[
|
||||||
"workspace-indicator@gnome-shell-extensions.gcampax.github.com"
|
"workspace-indicator@gnome-shell-extensions.gcampax.github.com"
|
||||||
]
|
]
|
||||||
@ -310,7 +315,7 @@ in {
|
|||||||
fixed-widths = true;
|
fixed-widths = true;
|
||||||
hide-icons = false;
|
hide-icons = false;
|
||||||
hide-zeros = false;
|
hide-zeros = false;
|
||||||
hot-sensors = [ "__network-rx_max__" ];
|
hot-sensors = ["__network-rx_max__"];
|
||||||
position-in-panel = 2;
|
position-in-panel = 2;
|
||||||
show-battery = false;
|
show-battery = false;
|
||||||
show-fan = false;
|
show-fan = false;
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
{ config, nixosConfig, lib, mylib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
nixosConfig,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
with mylib.modules;
|
with mylib.modules; let
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.kitty;
|
cfg = config.modules.kitty;
|
||||||
# cfgnv = config.modules.neovim;
|
# cfgnv = config.modules.neovim;
|
||||||
in {
|
in {
|
||||||
|
|
||||||
options.modules.kitty = {
|
options.modules.kitty = {
|
||||||
enable = mkEnableOpt "Kitty";
|
enable = mkEnableOpt "Kitty";
|
||||||
};
|
};
|
||||||
@ -30,7 +33,7 @@ in {
|
|||||||
|
|
||||||
# Light Theme
|
# Light Theme
|
||||||
# background = "#f7f7f7";
|
# background = "#f7f7f7";
|
||||||
# foreground = "#494542";
|
# foreground = "#39FF14"; # Matrix green because I'm a master hacker
|
||||||
# selection_background = "#a4a1a1";
|
# selection_background = "#a4a1a1";
|
||||||
# selection_foreground = "#f7f7f7";
|
# selection_foreground = "#f7f7f7";
|
||||||
# cursor = "#494542";
|
# cursor = "#494542";
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
{ config, nixosConfig, lib, mylib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
nixosConfig,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
with mylib.modules;
|
with mylib.modules; let
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.misc;
|
cfg = config.modules.misc;
|
||||||
in {
|
in {
|
||||||
options.modules.misc = {
|
options.modules.misc = {
|
||||||
@ -21,10 +25,10 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = with pkgs;
|
||||||
home.packages = with pkgs; builtins.concatLists [
|
builtins.concatLists [
|
||||||
(optionals cfg.keepass.enable [ keepassxc ])
|
(optionals cfg.keepass.enable [keepassxc])
|
||||||
(optionals cfg.protonmail.enable [ protonmail-bridge ])
|
(optionals cfg.protonmail.enable [protonmail-bridge])
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.user.services = mkMerge [
|
systemd.user.services = mkMerge [
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
{ config, nixosConfig, lib, mylib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
nixosConfig,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
with mylib.modules;
|
with mylib.modules; let
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.neovim;
|
cfg = config.modules.neovim;
|
||||||
in {
|
in {
|
||||||
|
|
||||||
options.modules.neovim = {
|
options.modules.neovim = {
|
||||||
enable = mkEnableOpt "NeoVim";
|
enable = mkEnableOpt "NeoVim";
|
||||||
alias = mkBoolOpt false "Link nvim to vim/vi";
|
alias = mkBoolOpt false "Link nvim to vim/vi";
|
||||||
@ -70,7 +73,7 @@ in {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
plugin = (nvim-treesitter.withPlugins (plugins: pkgs.tree-sitter.allGrammars));
|
plugin = nvim-treesitter.withPlugins (plugins: pkgs.tree-sitter.allGrammars);
|
||||||
config = ''
|
config = ''
|
||||||
lua << EOF
|
lua << EOF
|
||||||
require('nvim-treesitter.configs').setup {
|
require('nvim-treesitter.configs').setup {
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
# Changed from https://github.com/nix-community/home-manager/blob/master/modules/services/nextcloud-client.nix
|
# Changed from https://github.com/nix-community/home-manager/blob/master/modules/services/nextcloud-client.nix
|
||||||
# I use this instead of the HM module as the autostart wasn't working there
|
# I use this instead of the HM module as the autostart wasn't working there
|
||||||
|
|
||||||
# TODO: Check the HM module again if anything changed, as this has also stopped working
|
# TODO: Check the HM module again if anything changed, as this has also stopped working
|
||||||
# Nextcloud immediately crashes on start, autostart isn't working either...
|
# Nextcloud immediately crashes on start, autostart isn't working either...
|
||||||
|
{
|
||||||
{ config, lib, mylib, pkgs, ... }:
|
config,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
with mylib.modules;
|
with mylib.modules; let
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.nextcloud;
|
cfg = config.modules.nextcloud;
|
||||||
in {
|
in {
|
||||||
options.modules.nextcloud = {
|
options.modules.nextcloud = {
|
||||||
@ -26,7 +27,7 @@ in {
|
|||||||
];
|
];
|
||||||
|
|
||||||
# I want to have nextcloud-client in the path when the module is enabled
|
# I want to have nextcloud-client in the path when the module is enabled
|
||||||
home.packages = with pkgs; [ nextcloud-client ];
|
home.packages = with pkgs; [nextcloud-client];
|
||||||
|
|
||||||
# TODO: Disable only for plasma
|
# TODO: Disable only for plasma
|
||||||
# systemd.user.services = (mkIf cfg.autostart) {
|
# systemd.user.services = (mkIf cfg.autostart) {
|
||||||
|
@ -1,21 +1,20 @@
|
|||||||
# TODO: KDE Connect config
|
# TODO: KDE Connect config
|
||||||
# TODO: Plasma Configuration (https://github.com/pjones/plasma-manager)
|
# TODO: Plasma Configuration (https://github.com/pjones/plasma-manager)
|
||||||
|
{
|
||||||
{ config, lib, mylib, pkgs, ... }:
|
config,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
with mylib.modules;
|
with mylib.modules; let
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.plasma;
|
cfg = config.modules.plasma;
|
||||||
in {
|
in {
|
||||||
options.modules.plasma = {
|
options.modules.plasma = {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = with pkgs; [];
|
||||||
home.packages = with pkgs; [ ];
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,23 @@
|
|||||||
{ config, nixosConfig, lib, mylib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
nixosConfig,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
with mylib.modules;
|
with mylib.modules; let
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.ranger;
|
cfg = config.modules.ranger;
|
||||||
in {
|
in {
|
||||||
|
|
||||||
options.modules.ranger = {
|
options.modules.ranger = {
|
||||||
enable = mkEnableOpt "Ranger";
|
enable = mkEnableOpt "Ranger";
|
||||||
preview = mkBoolOpt false "Enable Ranger image preview";
|
preview = mkBoolOpt false "Enable Ranger image preview";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = with pkgs; lib.concatLists [
|
home.packages = with pkgs;
|
||||||
|
lib.concatLists [
|
||||||
[
|
[
|
||||||
ranger
|
ranger
|
||||||
atool
|
atool
|
||||||
@ -28,6 +32,7 @@ in {
|
|||||||
|
|
||||||
(optionals cfg.preview [
|
(optionals cfg.preview [
|
||||||
# ueberzug # Only X11
|
# ueberzug # Only X11
|
||||||
|
# TODO: Conflicts with global python?
|
||||||
python310Packages.pillow
|
python310Packages.pillow
|
||||||
ffmpegthumbnailer
|
ffmpegthumbnailer
|
||||||
imagemagick
|
imagemagick
|
||||||
@ -39,16 +44,27 @@ in {
|
|||||||
{
|
{
|
||||||
".config/ranger/rc.conf".text = let
|
".config/ranger/rc.conf".text = let
|
||||||
# TODO: Why does mkMerge don't work here?
|
# TODO: Why does mkMerge don't work here?
|
||||||
settings = {
|
settings =
|
||||||
|
{
|
||||||
column_ratios = "1,1";
|
column_ratios = "1,1";
|
||||||
vcs_aware = "true";
|
vcs_aware = "true";
|
||||||
preview_images_method = "kitty"; # TODO: Only if kitty enabled
|
preview_images_method = "kitty"; # TODO: Only if kitty enabled
|
||||||
unicode_ellipsis = "true";
|
unicode_ellipsis = "true";
|
||||||
draw_borders = (if cfg.preview then "none" else "both"); # doesn't work well with preview
|
draw_borders =
|
||||||
|
if cfg.preview
|
||||||
|
then "none"
|
||||||
|
else "both"; # doesn't work well with preview
|
||||||
line_numbers = "relative";
|
line_numbers = "relative";
|
||||||
preview_images = (if cfg.preview then "true" else "false");
|
preview_images =
|
||||||
use_preview_script = (if cfg.preview then "true" else "false");
|
if cfg.preview
|
||||||
} // (optionalAttrs cfg.preview {
|
then "true"
|
||||||
|
else "false";
|
||||||
|
use_preview_script =
|
||||||
|
if cfg.preview
|
||||||
|
then "true"
|
||||||
|
else "false";
|
||||||
|
}
|
||||||
|
// (optionalAttrs cfg.preview {
|
||||||
preview_script = "${config.home.homeDirectory}/.config/ranger/scope.sh";
|
preview_script = "${config.home.homeDirectory}/.config/ranger/scope.sh";
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -56,8 +72,8 @@ in {
|
|||||||
settings_in_values = mapAttrs (name: value: concatStringsSep " " ["set" name value]) settings;
|
settings_in_values = mapAttrs (name: value: concatStringsSep " " ["set" name value]) settings;
|
||||||
settings_list = attrValues settings_in_values; # Results in [ "set column_rations = 1,1" ]
|
settings_list = attrValues settings_in_values; # Results in [ "set column_rations = 1,1" ]
|
||||||
settings_str = concatStringsSep "\n" settings_list;
|
settings_str = concatStringsSep "\n" settings_list;
|
||||||
|
in
|
||||||
in settings_str;
|
settings_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
(optionalAttrs cfg.preview {
|
(optionalAttrs cfg.preview {
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
{ inputs, pkgs, lib, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
nixos = import ./nixos.nix { inherit inputs pkgs lib; };
|
inputs,
|
||||||
modules = import ./modules.nix { inherit inputs pkgs lib; };
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
nixos = import ./nixos.nix {inherit inputs pkgs lib;};
|
||||||
|
modules = import ./modules.nix {inherit inputs pkgs lib;};
|
||||||
}
|
}
|
@ -1,6 +1,9 @@
|
|||||||
{ inputs, pkgs, lib, ... }:
|
{
|
||||||
|
inputs,
|
||||||
rec {
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: rec {
|
||||||
# Conveniance wrapper for mkOption with boolean type
|
# Conveniance wrapper for mkOption with boolean type
|
||||||
mkBoolOpt = def: desc:
|
mkBoolOpt = def: desc:
|
||||||
lib.mkOption {
|
lib.mkOption {
|
||||||
@ -13,13 +16,11 @@ rec {
|
|||||||
mkEnableOpt = lib.mkEnableOption;
|
mkEnableOpt = lib.mkEnableOption;
|
||||||
|
|
||||||
# Like mkIf but the predicate is inverted
|
# Like mkIf but the predicate is inverted
|
||||||
mkElse = pred: do:
|
mkElse = pred: do: (lib.mkIf (!pred) do);
|
||||||
(lib.mkIf (!pred) do);
|
|
||||||
|
|
||||||
# Creates a symlink if it doesn't exist
|
# Creates a symlink if it doesn't exist
|
||||||
# If it exists renew the link
|
# If it exists renew the link
|
||||||
mkLink = src: dest:
|
mkLink = src: dest: ''
|
||||||
''
|
|
||||||
if [ -L "${dest}" ]; then
|
if [ -L "${dest}" ]; then
|
||||||
rm ${dest}
|
rm ${dest}
|
||||||
fi
|
fi
|
||||||
@ -27,23 +28,18 @@ rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
# Removes a symlink if it exists
|
# Removes a symlink if it exists
|
||||||
mkUnlink = dest:
|
mkUnlink = dest: ''
|
||||||
''
|
|
||||||
if [ -L "${dest}" ]; then
|
if [ -L "${dest}" ]; then
|
||||||
rm ${dest}
|
rm ${dest}
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
mkMultiOptStr = { }:
|
mkMultiOptStr = {}: {
|
||||||
{
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
mkMultiOptPkg = { }:
|
mkMultiOptPkg = {}: {
|
||||||
{
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Returns true if base contains element
|
# Returns true if base contains element
|
||||||
@ -57,10 +53,18 @@ rec {
|
|||||||
# For use with single element sets
|
# For use with single element sets
|
||||||
attrName = set: let
|
attrName = set: let
|
||||||
names = lib.attrNames set;
|
names = lib.attrNames set;
|
||||||
in (if (names != [ ]) then (lib.head names) else null);
|
in (
|
||||||
|
if (names != [])
|
||||||
|
then (lib.head names)
|
||||||
|
else null
|
||||||
|
);
|
||||||
|
|
||||||
# For use with single element sets
|
# For use with single element sets
|
||||||
attrValue = set: let
|
attrValue = set: let
|
||||||
values = lib.attrValues set;
|
values = lib.attrValues set;
|
||||||
in (if (values != [ ]) then (lib.head values) else null);
|
in (
|
||||||
|
if (values != [])
|
||||||
|
then (lib.head values)
|
||||||
|
else null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,29 @@
|
|||||||
{ inputs, pkgs, lib, ... }:
|
{
|
||||||
|
inputs,
|
||||||
let
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
inherit (inputs) home-manager;
|
inherit (inputs) home-manager;
|
||||||
|
|
||||||
in {
|
in {
|
||||||
mkNixosConfig = { system ? "x86_64-linux", mylib, hostname, username ? "christoph", extraModules ? [ ] }:
|
mkNixosConfig = {
|
||||||
|
system ? "x86_64-linux",
|
||||||
|
mylib,
|
||||||
|
hostname,
|
||||||
|
username ? "christoph",
|
||||||
|
extraModules ? [],
|
||||||
|
}:
|
||||||
lib.nixosSystem {
|
lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
|
|
||||||
# Make our inputs available to the configuration.nix (for importing modules)
|
# Make our inputs available to the configuration.nix (for importing modules)
|
||||||
# specialArgs are propagated to all modules
|
# specialArgs are propagated to all modules
|
||||||
specialArgs = { inherit inputs hostname username mylib; };
|
specialArgs = {inherit inputs hostname username mylib;};
|
||||||
|
|
||||||
modules = builtins.concatLists [
|
modules = builtins.concatLists [
|
||||||
[
|
[
|
||||||
# Replace the pkgs to include overlays/unfree
|
# Replace the pkgs to include overlays/unfree
|
||||||
{ nixpkgs.pkgs = pkgs; }
|
{nixpkgs.pkgs = pkgs;}
|
||||||
|
|
||||||
# Main config file for all configs/hosts
|
# Main config file for all configs/hosts
|
||||||
../system
|
../system
|
||||||
@ -28,9 +36,10 @@ in {
|
|||||||
# but I failed because nix stopped autoinjecting the required arguments and I didn't
|
# but I failed because nix stopped autoinjecting the required arguments and I didn't
|
||||||
# know how to handle that...
|
# know how to handle that...
|
||||||
[
|
[
|
||||||
home-manager.nixosModules.home-manager {
|
home-manager.nixosModules.home-manager
|
||||||
|
{
|
||||||
# extraSpecialArgs are propagated to all hm config modules
|
# extraSpecialArgs are propagated to all hm config modules
|
||||||
home-manager.extraSpecialArgs = { inherit inputs hostname username mylib; };
|
home-manager.extraSpecialArgs = {inherit inputs hostname username mylib;};
|
||||||
|
|
||||||
# Use systems pkgs, disables nixpkgs.* options in home.nix
|
# Use systems pkgs, disables nixpkgs.* options in home.nix
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
@ -39,7 +48,7 @@ in {
|
|||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
|
|
||||||
# User specific config file
|
# User specific config file
|
||||||
home-manager.users.${username}.imports = [ ../home/${username} ];
|
home-manager.users.${username}.imports = [../home/${username}];
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
@ -1,18 +1,23 @@
|
|||||||
{ inputs, nixpkgs, ... }:
|
{
|
||||||
|
inputs,
|
||||||
let
|
nixpkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
# Taken from https://github.com/Misterio77/nix-config/blob/main/overlay/default.nix
|
# Taken from https://github.com/Misterio77/nix-config/blob/main/overlay/default.nix
|
||||||
# By specifying this we can just add our derivation to derivations/default.nix and it will land here
|
# By specifying this we can just add our derivation to derivations/default.nix and it will land here
|
||||||
additions = final: prev: import ../derivations { inherit inputs; pkgs = final; };
|
additions = final: prev:
|
||||||
|
import ../derivations {
|
||||||
|
inherit inputs;
|
||||||
|
pkgs = final;
|
||||||
|
};
|
||||||
|
|
||||||
modifications = final: prev: rec {
|
modifications = final: prev: rec {
|
||||||
# dconf-editor-wrapped = import ./dconf-editor.nix { inherit final prev; }; # Only kept as an example, has nothing to do with current dconf-editor-wrapped derivation
|
# dconf-editor-wrapped = import ./dconf-editor.nix { inherit final prev; }; # Only kept as an example, has nothing to do with current dconf-editor-wrapped derivation
|
||||||
# Use dconf-editor.nix: { final, prev }: final.<package>.overrideAttrs (oldAttrs: { ... }) or sth similar
|
# Use dconf-editor.nix: { final, prev }: final.<package>.overrideAttrs (oldAttrs: { ... }) or sth similar
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
# TODO: I have absolutely no clue what happens here lol
|
# TODO: I have absolutely no clue what happens here lol
|
||||||
# Basically we need some sort of list of all overlays that can be imported from the flake
|
# Basically we need some sort of list of all overlays that can be imported from the flake
|
||||||
# in the overlays = [ ... ] section of the pkgs = import nixpkgs { ... } configuration
|
# in the overlays = [ ... ] section of the pkgs = import nixpkgs { ... } configuration
|
||||||
# Somehow this library function turns additions/modifications into that
|
# Somehow this library function turns additions/modifications into that
|
||||||
nixpkgs.lib.composeManyExtensions [ additions modifications ]
|
nixpkgs.lib.composeManyExtensions [additions modifications]
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
{ pkgs }:
|
{pkgs}:
|
||||||
|
|
||||||
pkgs.devshell.mkShell {
|
pkgs.devshell.mkShell {
|
||||||
name = "NixFlake Shell";
|
name = "NixFlake Shell";
|
||||||
|
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
# WARN: this file will get overwritten by $ cachix use <name>
|
# WARN: this file will get overwritten by $ cachix use <name>
|
||||||
{ pkgs, lib, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
let
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
folder = ./cachix;
|
folder = ./cachix;
|
||||||
toImport = name: value: folder + ("/" + name);
|
toImport = name: value: folder + ("/" + name);
|
||||||
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key;
|
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key;
|
||||||
imports = lib.mapAttrsToList toImport
|
imports =
|
||||||
|
lib.mapAttrsToList toImport
|
||||||
(lib.filterAttrs filterCaches (builtins.readDir folder));
|
(lib.filterAttrs filterCaches (builtins.readDir folder));
|
||||||
in {
|
in {
|
||||||
inherit imports;
|
inherit imports;
|
||||||
nix.settings.substituters = [ "https://cache.nixos.org/" ];
|
nix.settings.substituters = ["https://cache.nixos.org/"];
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
nix.settings = {
|
nix.settings = {
|
||||||
substituters = [
|
substituters = [
|
||||||
|
@ -1,10 +1,15 @@
|
|||||||
# Edit this configuration file to define what should be installed on
|
# Edit this configuration file to define what should be installed on
|
||||||
# your system. Help is available in the configuration.nix(5) man page
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
|
|
||||||
{ inputs, hostname, lib, mylib, config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
inputs,
|
||||||
|
hostname,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
# Import the host-specific system config
|
# Import the host-specific system config
|
||||||
./${hostname}
|
./${hostname}
|
||||||
@ -19,7 +24,7 @@
|
|||||||
experimental-features = nix-command flakes
|
experimental-features = nix-command flakes
|
||||||
'';
|
'';
|
||||||
|
|
||||||
settings.trusted-users = [ "root" "christoph" ];
|
settings.trusted-users = ["root" "christoph"];
|
||||||
|
|
||||||
# Keep nix-shell from garbage collection for direnv (keep-outputs + keep-derivations)
|
# Keep nix-shell from garbage collection for direnv (keep-outputs + keep-derivations)
|
||||||
# NOTE: nix-direnv use nix or use flake should do this automatically
|
# NOTE: nix-direnv use nix or use flake should do this automatically
|
||||||
@ -35,13 +40,13 @@
|
|||||||
# This will add your inputs as registries, making operations with them (such
|
# This will add your inputs as registries, making operations with them (such
|
||||||
# as nix shell nixpkgs#name) consistent with your flake inputs.
|
# as nix shell nixpkgs#name) consistent with your flake inputs.
|
||||||
# (Registry contains flakes)
|
# (Registry contains flakes)
|
||||||
registry = lib.mapAttrs' (n: v: lib.nameValuePair n { flake = v; }) inputs;
|
registry = lib.mapAttrs' (n: v: lib.nameValuePair n {flake = v;}) inputs;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Bootloader/Kernel stuff
|
# Bootloader/Kernel stuff
|
||||||
boot = {
|
boot = {
|
||||||
kernelPackages = pkgs.linuxPackages_zen;
|
kernelPackages = pkgs.linuxPackages_zen;
|
||||||
kernelParams = [ "mitigations=off" ];
|
kernelParams = ["mitigations=off"];
|
||||||
|
|
||||||
# plymouth.enable = true;
|
# plymouth.enable = true;
|
||||||
loader.systemd-boot.enable = true;
|
loader.systemd-boot.enable = true;
|
||||||
@ -63,7 +68,7 @@
|
|||||||
sudo.enable = true;
|
sudo.enable = true;
|
||||||
sudo.extraRules = [
|
sudo.extraRules = [
|
||||||
{
|
{
|
||||||
users = [ "christoph" ];
|
users = ["christoph"];
|
||||||
commands = [
|
commands = [
|
||||||
# Launch gamemode without password because it is annoying
|
# Launch gamemode without password because it is annoying
|
||||||
# {
|
# {
|
||||||
@ -78,7 +83,7 @@
|
|||||||
# We allow running flatpak without password so flatpaks can be installed from the hm config (needs sudo)
|
# We allow running flatpak without password so flatpaks can be installed from the hm config (needs sudo)
|
||||||
{
|
{
|
||||||
command = "/run/current-system/sw/bin/flatpak";
|
command = "/run/current-system/sw/bin/flatpak";
|
||||||
options = [ "SETENV" "NOPASSWD" ];
|
options = ["SETENV" "NOPASSWD"];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -104,7 +109,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/issues/179486
|
# https://github.com/NixOS/nixpkgs/issues/179486
|
||||||
i18n.supportedLocales = [ "en_US.UTF-8/UTF-8" "de_DE.UTF-8/UTF-8" ];
|
i18n.supportedLocales = ["en_US.UTF-8/UTF-8" "de_DE.UTF-8/UTF-8"];
|
||||||
|
|
||||||
# TODO: Other ports (tcp/udp/ssh...)?
|
# TODO: Other ports (tcp/udp/ssh...)?
|
||||||
# Open ports in the firewall.
|
# Open ports in the firewall.
|
||||||
@ -121,10 +126,9 @@
|
|||||||
# Enable networking
|
# Enable networking
|
||||||
networkmanager.enable = true;
|
networkmanager.enable = true;
|
||||||
|
|
||||||
|
|
||||||
firewall.enable = true;
|
firewall.enable = true;
|
||||||
firewall.allowedTCPPorts = [ ];
|
firewall.allowedTCPPorts = [];
|
||||||
firewall.allowedTCPPortRanges = [ ];
|
firewall.allowedTCPPortRanges = [];
|
||||||
|
|
||||||
firewall.allowedUDPPorts = [
|
firewall.allowedUDPPorts = [
|
||||||
18000 # Anno 1800
|
18000 # Anno 1800
|
||||||
@ -132,8 +136,7 @@
|
|||||||
9995 # TelemetryApp
|
9995 # TelemetryApp
|
||||||
9996 # TelemetryApp
|
9996 # TelemetryApp
|
||||||
];
|
];
|
||||||
firewall.allowedUDPPortRanges = [ ];
|
firewall.allowedUDPPortRanges = [];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable the X11 windowing system.
|
# Enable the X11 windowing system.
|
||||||
@ -203,7 +206,7 @@
|
|||||||
victor-mono
|
victor-mono
|
||||||
jetbrains-mono
|
jetbrains-mono
|
||||||
source-code-pro
|
source-code-pro
|
||||||
(pkgs.nerdfonts.override { fonts = [ "VictorMono" ]; })
|
(pkgs.nerdfonts.override {fonts = ["VictorMono"];})
|
||||||
|
|
||||||
# Chinese fonts
|
# Chinese fonts
|
||||||
source-han-mono
|
source-han-mono
|
||||||
@ -262,7 +265,7 @@
|
|||||||
];
|
];
|
||||||
shell = pkgs.fish; # TODO: Is this needed if programs.fish.enable = true?
|
shell = pkgs.fish; # TODO: Is this needed if programs.fish.enable = true?
|
||||||
# We do this with HomeManager
|
# We do this with HomeManager
|
||||||
packages = with pkgs; [ ];
|
packages = with pkgs; [];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Generate a list of installed system packages in /etc/current-system-packages
|
# Generate a list of installed system packages in /etc/current-system-packages
|
||||||
@ -273,10 +276,9 @@
|
|||||||
in
|
in
|
||||||
formatted;
|
formatted;
|
||||||
|
|
||||||
|
|
||||||
# We want these packages to be available even when no user profile is active
|
# We want these packages to be available even when no user profile is active
|
||||||
# Empty since we basically only need git + editor which is enabled below
|
# Empty since we basically only need git + editor which is enabled below
|
||||||
environment.systemPackages = with pkgs; [ ];
|
environment.systemPackages = with pkgs; [];
|
||||||
|
|
||||||
# NOTE: Gnome
|
# NOTE: Gnome
|
||||||
# TODO: Identify all the crap
|
# TODO: Identify all the crap
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
{ inputs, config, lib, mylib, pkgs, ... }:
|
{
|
||||||
|
inputs,
|
||||||
rec {
|
config,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: rec {
|
||||||
imports = [
|
imports = [
|
||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
@ -20,6 +25,6 @@ rec {
|
|||||||
xkbVariant = "altgr-intl";
|
xkbVariant = "altgr-intl";
|
||||||
|
|
||||||
# videoDrivers = [ "nvidia" ]; # NVIDIA
|
# videoDrivers = [ "nvidia" ]; # NVIDIA
|
||||||
videoDrivers = [ "amdgpu" ];
|
videoDrivers = ["amdgpu"];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,23 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
|
||||||
# Enable early Nvidia kernel modesetting
|
# Enable early Nvidia kernel modesetting
|
||||||
# https://wiki.archlinux.org/title/GDM#GDM_ignores_Wayland_and_uses_X.Org_by_default (not fixed by this)
|
# https://wiki.archlinux.org/title/GDM#GDM_ignores_Wayland_and_uses_X.Org_by_default (not fixed by this)
|
||||||
# https://wiki.archlinux.org/title/Kernel_mode_setting#Early_KMS_start
|
# https://wiki.archlinux.org/title/Kernel_mode_setting#Early_KMS_start
|
||||||
# initrd.kernelModules = [ "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ]; # NVIDIA
|
# initrd.kernelModules = [ "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ]; # NVIDIA
|
||||||
initrd.kernelModules = [ "amdgpu" ];
|
initrd.kernelModules = ["amdgpu"];
|
||||||
kernelModules = [ "kvm-intel" ];
|
kernelModules = ["kvm-intel"];
|
||||||
# Specific to used kernel (currently linux_zen)
|
# Specific to used kernel (currently linux_zen)
|
||||||
extraModulePackages = with pkgs.linuxKernel.packages.linux_zen; [
|
extraModulePackages = with pkgs.linuxKernel.packages.linux_zen; [
|
||||||
new-lg4ff # Logitech force feedback
|
new-lg4ff # Logitech force feedback
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
{ inputs, config, lib, mylib, pkgs, ... }:
|
{
|
||||||
|
inputs,
|
||||||
rec {
|
config,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: rec {
|
||||||
imports = [
|
imports = [
|
||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
@ -12,6 +17,6 @@ rec {
|
|||||||
xkbVariant = "nodeadkeys";
|
xkbVariant = "nodeadkeys";
|
||||||
|
|
||||||
# Proprietary graphics drivers
|
# Proprietary graphics drivers
|
||||||
videoDrivers = [ "intel" ];
|
videoDrivers = ["intel"];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,22 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
|
initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"];
|
||||||
initrd.kernelModules = [ ];
|
initrd.kernelModules = [];
|
||||||
kernelModules = [ "kvm-intel" ];
|
kernelModules = ["kvm-intel"];
|
||||||
extraModulePackages = [ ];
|
extraModulePackages = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
@ -25,7 +29,7 @@
|
|||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices = [ ];
|
swapDevices = [];
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
Reference in New Issue
Block a user