2023-04-07 11:09:21 -04:00
|
|
|
|
# Edit this configuration file to define what should be installed on
|
|
|
|
|
# your system. Help is available in the configuration.nix(5) man page
|
|
|
|
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
|
|
|
|
|
2023-04-08 18:49:00 -04:00
|
|
|
|
{ config, pkgs, lib, ... }:
|
2023-04-07 11:09:21 -04:00
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
imports =
|
|
|
|
|
[
|
|
|
|
|
# Include the results of the hardware scan.
|
|
|
|
|
./hardware-configuration.nix
|
|
|
|
|
|
|
|
|
|
# Applications that run on this server
|
2023-04-07 22:05:23 -04:00
|
|
|
|
../nixos-apps/ewanick.com.nix
|
|
|
|
|
../nixos-apps/git.ewanick.com.nix
|
2023-04-08 21:40:56 -04:00
|
|
|
|
../nixos-apps/crueltysquad.com.nix
|
2023-04-08 22:38:32 -04:00
|
|
|
|
../nixos-apps/jitsi.crueltysquad.com.nix
|
2023-04-08 21:40:56 -04:00
|
|
|
|
../nixos-apps/cutesealfanpage.love.nix
|
|
|
|
|
../nixos-apps/fancytypist.com.nix
|
2023-06-27 11:26:33 -04:00
|
|
|
|
# ../nixos-apps/seal-blog
|
2023-04-07 11:09:21 -04:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# Use the GRUB 2 boot loader.
|
|
|
|
|
boot.loader.grub.enable = true;
|
|
|
|
|
networking.usePredictableInterfaceNames = false;
|
|
|
|
|
networking.hostName = "linode-nixos";
|
|
|
|
|
|
|
|
|
|
# Set your time zone.
|
|
|
|
|
time.timeZone = "America/Toronto";
|
|
|
|
|
|
|
|
|
|
# Nix daemon config
|
|
|
|
|
nix = {
|
|
|
|
|
# Automate garbage collection
|
|
|
|
|
gc = {
|
|
|
|
|
automatic = true;
|
|
|
|
|
dates = "weekly";
|
|
|
|
|
options = "--delete-older-than 7d";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
package = pkgs.nixVersions.stable;
|
|
|
|
|
extraOptions = ''
|
|
|
|
|
# https://github.com/nix-community/nix-direnv#home-manager
|
|
|
|
|
keep-outputs = true
|
|
|
|
|
keep-derivations = true
|
|
|
|
|
|
|
|
|
|
# Enable the nix 2.0 CLI and flakes support feature-flags
|
|
|
|
|
experimental-features = nix-command flakes
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
|
# Automate `nix store --optimise`
|
|
|
|
|
auto-optimise-store = true;
|
|
|
|
|
|
|
|
|
|
# Required by Cachix to be used as non-root user
|
2023-06-28 19:46:20 -04:00
|
|
|
|
trusted-users = [ "root" "alice" ];
|
2023-04-07 11:09:21 -04:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Configure keymap in X11
|
|
|
|
|
services.xserver.layout = "us";
|
|
|
|
|
services.xserver.xkbOptions = "ctrl:swapcaps";
|
|
|
|
|
|
|
|
|
|
# Define a user account. Don't forget to set a password with ‘passwd’.
|
|
|
|
|
users.users.alice = {
|
|
|
|
|
isNormalUser = true;
|
|
|
|
|
home = "/home/alice";
|
|
|
|
|
description = "Alice Foobar";
|
|
|
|
|
extraGroups = [ "wheel" "networkmanager" ];
|
|
|
|
|
packages = with pkgs; [
|
|
|
|
|
tldr
|
|
|
|
|
];
|
2023-06-27 16:33:33 -04:00
|
|
|
|
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGzXqcOu6/EjS60Ke55w4hj//lY6u3S1DYPoSd7yjdR3 alice@foobar" ];
|
2023-04-07 11:09:21 -04:00
|
|
|
|
};
|
|
|
|
|
|
2023-06-27 16:33:33 -04:00
|
|
|
|
|
2023-04-07 11:09:21 -04:00
|
|
|
|
# List packages installed in system profile. To search, run:
|
|
|
|
|
# $ nix search wget
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
|
wget
|
|
|
|
|
git
|
|
|
|
|
kitty
|
|
|
|
|
|
|
|
|
|
# Linode tools
|
|
|
|
|
inetutils
|
|
|
|
|
mtr
|
|
|
|
|
sysstat
|
|
|
|
|
];
|
|
|
|
|
|
2023-04-08 18:49:00 -04:00
|
|
|
|
# Enable Nix-ld for remote VSCode SSH to work
|
|
|
|
|
programs.nix-ld.enable = true;
|
|
|
|
|
environment.variables = {
|
2023-06-27 11:26:33 -04:00
|
|
|
|
NIX_LD_LIBRARY_PATH = lib.mkDefault (lib.makeLibraryPath [
|
2023-04-08 22:38:32 -04:00
|
|
|
|
pkgs.stdenv.cc.cc
|
2023-06-27 11:26:33 -04:00
|
|
|
|
]);
|
|
|
|
|
NIX_LD = lib.mkDefault (lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker");
|
2023-04-08 18:49:00 -04:00
|
|
|
|
};
|
|
|
|
|
|
2023-04-07 11:09:21 -04:00
|
|
|
|
# Enable the OpenSSH daemon.
|
|
|
|
|
services.openssh = {
|
|
|
|
|
enable = true;
|
2023-06-27 11:26:33 -04:00
|
|
|
|
settings = {
|
|
|
|
|
PermitRootLogin = "no";
|
|
|
|
|
};
|
2023-04-07 11:09:21 -04:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Open ports in the firewall.
|
|
|
|
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
|
|
|
|
networking.useDHCP = false;
|
|
|
|
|
networking.interfaces.eth0.useDHCP = true;
|
|
|
|
|
|
2023-04-08 18:49:00 -04:00
|
|
|
|
# Linode Longview monitoring
|
2023-04-07 11:09:21 -04:00
|
|
|
|
services.longview = {
|
|
|
|
|
enable = true;
|
|
|
|
|
apiKeyFile = "/var/lib/longview/apiKeyFile";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# This value determines the NixOS release from which the default
|
|
|
|
|
# settings for stateful data, like file locations and database versions
|
|
|
|
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
|
|
|
# this value at the release version of the first install of this system.
|
|
|
|
|
# Before changing this value read the documentation for this option
|
|
|
|
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
2023-06-27 11:26:33 -04:00
|
|
|
|
system.stateVersion = "23.05"; # Did you read the comment?
|
2023-04-07 11:09:21 -04:00
|
|
|
|
}
|