2023-12-12 00:48:10 +01:00
|
|
|
# Edit this configuration file to define what should be installed on
|
|
|
|
# your system. Help is available in the configuration.nix(5) man page
|
2023-12-12 01:29:57 +01:00
|
|
|
# and in the NixOS manual (accessible by running 'nixos-help').
|
2023-12-12 00:48:10 +01:00
|
|
|
|
2024-06-20 19:55:34 +02:00
|
|
|
{ inputs, lib, pkgs, ... }:
|
2023-12-12 00:48:10 +01:00
|
|
|
|
2024-05-28 21:51:35 +02:00
|
|
|
let
|
2024-07-09 11:47:10 +02:00
|
|
|
inherit (pkgs) mkWrappedExecutable;
|
2024-05-31 23:47:56 +02:00
|
|
|
|
2024-06-01 01:12:39 +02:00
|
|
|
# bool -> nixpkgs[]
|
|
|
|
wrappedNixExecutables = inEnvironment: assert builtins.isBool inEnvironment; [
|
|
|
|
(mkWrappedExecutable {pkg = pkgs.nix; exe = "nix-build"; wrapperArgs = ["--add-flags" "\"--log-format\"" "--add-flags" "bar${lib.optionalString inEnvironment "-with-logs"}"];})
|
2024-05-28 21:51:35 +02:00
|
|
|
(mkWrappedExecutable {pkg = pkgs.nix; exe = "nix-shell"; wrapperArgs = ["--add-flags" "\"--log-format\"" "--add-flags" "bar"];})
|
|
|
|
];
|
2024-06-01 03:27:45 +02:00
|
|
|
wrappedNixosExecutables = [
|
|
|
|
(mkWrappedExecutable {pkg = pkgs.nixos-rebuild; wrapperArgs = ["--add-flags" "\"--log-format\"" "--add-flags" "bar"];})
|
|
|
|
];
|
2024-06-01 01:12:39 +02:00
|
|
|
wrappedNix = (pkgs.buildEnv {
|
|
|
|
name = "wrappedNix-${pkgs.nix.version}";
|
|
|
|
paths = [ pkgs.nix ] ++ wrappedNixExecutables false;
|
|
|
|
}).overrideAttrs {
|
|
|
|
version = pkgs.nix.version;
|
2024-10-18 14:24:15 +02:00
|
|
|
passthru.meta = pkgs.nix.meta;
|
2024-06-01 01:12:39 +02:00
|
|
|
};
|
2024-05-28 21:51:35 +02:00
|
|
|
in
|
2023-12-12 00:48:10 +01:00
|
|
|
{
|
2024-11-30 20:34:58 +01:00
|
|
|
imports = [
|
|
|
|
./module-overrides.nix
|
|
|
|
];
|
|
|
|
|
2023-12-22 00:54:40 +01:00
|
|
|
# kernel
|
2024-12-02 05:51:25 +01:00
|
|
|
# FIXME: current cosmic-greeter (2024-12-02) fails to start with kernel 6.12
|
|
|
|
boot.kernelPackages = pkgs.linuxPackages_6_11;
|
2023-12-22 00:54:40 +01:00
|
|
|
|
2023-12-12 00:48:10 +01:00
|
|
|
# Enable networking
|
|
|
|
networking.networkmanager.enable = true;
|
|
|
|
|
|
|
|
# Allow unfree packages
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
2024-06-20 19:55:34 +02:00
|
|
|
nix = {
|
|
|
|
package = wrappedNix;
|
|
|
|
channel.enable = false;
|
2024-09-08 20:22:19 +02:00
|
|
|
settings.experimental-features = [
|
|
|
|
"no-url-literals"
|
|
|
|
];
|
2024-12-02 06:36:46 +01:00
|
|
|
nixPath = [
|
2024-06-20 19:55:34 +02:00
|
|
|
"nixpkgs=${pkgs.selfExpr { useConfig = false; }}"
|
|
|
|
"systemNixpkgs=${pkgs.selfExpr { useConfig = true; name = "systemNixpkgs-self"; }}"
|
|
|
|
# don't garbage collect the nixpkgs input
|
|
|
|
"inputsNixpkgs=${inputs.nixpkgs}"
|
|
|
|
];
|
|
|
|
};
|
2023-12-12 00:48:10 +01:00
|
|
|
|
|
|
|
# List packages installed in system profile. To search, run:
|
|
|
|
# $ nix search wget
|
|
|
|
environment.systemPackages = with pkgs; [
|
2024-12-03 09:06:23 +01:00
|
|
|
waypipe
|
2023-12-12 00:48:10 +01:00
|
|
|
wget
|
|
|
|
ffmpeg
|
|
|
|
yt-dlp
|
|
|
|
htop
|
|
|
|
btop
|
2024-05-02 10:00:04 +02:00
|
|
|
fastfetch
|
2023-12-12 00:48:10 +01:00
|
|
|
smartmontools
|
|
|
|
ddrescue
|
2024-06-01 03:27:45 +02:00
|
|
|
] ++ wrappedNixExecutables true
|
|
|
|
++ wrappedNixosExecutables;
|
2023-12-12 00:48:10 +01:00
|
|
|
|
2024-05-28 12:22:59 +02:00
|
|
|
programs.git.enable = true;
|
2024-05-28 12:18:08 +02:00
|
|
|
programs.git.config = {
|
2024-10-27 20:05:03 +01:00
|
|
|
commit.verbose = true;
|
2024-05-28 12:18:08 +02:00
|
|
|
init.defaultBranch = "main";
|
|
|
|
merge.conflictstyle = "diff3";
|
|
|
|
rerere.enabled = true;
|
|
|
|
};
|
|
|
|
|
2024-07-09 06:35:14 +02:00
|
|
|
# Use nix-index for command-not-found handler
|
|
|
|
programs.command-not-found.enable = false;
|
|
|
|
programs.nix-index = {
|
2024-07-09 11:22:27 +02:00
|
|
|
package = pkgs.nix-index.override {
|
|
|
|
nix-index-unwrapped = pkgs.nix-index-unwrapped.overrideAttrs (oldAttrs: {
|
|
|
|
patches = oldAttrs.patches or [] ++ [
|
|
|
|
../pkgs/by-name/ni/nix-index/cnfOutput.patch
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
2024-07-09 06:35:14 +02:00
|
|
|
enable = true;
|
|
|
|
enableBashIntegration = true;
|
|
|
|
};
|
|
|
|
|
2023-12-12 00:48:10 +01:00
|
|
|
# Enable fail2ban because of the OpenSSH server
|
|
|
|
services.fail2ban = {
|
|
|
|
enable = true;
|
|
|
|
maxretry = 10;
|
|
|
|
bantime = "7d";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Enable the OpenSSH daemon.
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
ports = [
|
|
|
|
22
|
|
|
|
8022
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|