nixos-config/configuration.nix

156 lines
4 KiB
Nix
Raw Normal View History

2021-01-27 18:22:02 +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
# and in the NixOS manual (accessible by running nixos-help).
2021-01-30 18:11:02 +01:00
{ config, lib, pkgs, ... }:
2021-01-27 18:22:02 +01:00
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./services
2021-01-27 18:22:02 +01:00
];
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only
networking.hostName = "poseidon"; # Define your hostname.
networking.domain = "alarsyo.net";
2021-01-27 18:22:02 +01:00
# Set your time zone.
time.timeZone = "Europe/Paris";
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
networking.interfaces.eno1.ipv4.addresses = [
{
address = "163.172.11.110";
prefixLength = 24;
}
];
networking.defaultGateway = {
address = "163.172.11.1";
interface = "eno1";
};
networking.nameservers = [
"62.210.16.6"
"62.210.16.7"
];
# Define a user account.
2021-02-05 22:36:55 +01:00
users.mutableUsers = false;
users.users.root = {
hashedPassword = lib.fileContents ./secrets/shadow-hashed-password-root;
};
2021-01-27 18:22:02 +01:00
users.users.alarsyo = {
hashedPassword = lib.fileContents ./secrets/shadow-hashed-password-alarsyo;
2021-01-27 18:22:02 +01:00
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
shell = pkgs.fish;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH3rrF3VSWI4n4cpguvlmLAaU3uftuX4AVV/39S/8GO9 alarsyo@thinkpad"
];
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
2021-01-27 18:26:59 +01:00
bat
2021-01-27 18:22:02 +01:00
fish
git
htop
2021-01-29 15:29:30 +01:00
ripgrep
2021-01-27 18:26:59 +01:00
stow
2021-01-27 18:22:02 +01:00
tmux
vim
wget
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
programs.fish.enable = true;
2021-01-27 18:22:02 +01:00
# List services that you want to enable:
my.services = {
2021-01-31 00:31:43 +01:00
bitwarden_rs = {
enable = true;
privatePort = 8081;
websocketPort = 3012;
};
2021-01-30 18:11:02 +01:00
borg-backup = {
enable = true;
2021-02-05 22:12:07 +01:00
repo = lib.fileContents ./secrets/borg-backup-repo;
2021-01-30 18:11:02 +01:00
};
2021-01-30 21:14:27 +01:00
2021-02-02 16:55:19 +01:00
gitea = {
enable = true;
privatePort = 8082;
};
2021-01-30 21:14:27 +01:00
miniflux = {
enable = true;
2021-01-31 13:25:29 +01:00
adminCredentialsFile = "${./secrets/miniflux-admin-credentials}";
2021-01-30 21:14:27 +01:00
privatePort = 8080;
};
2021-02-02 01:20:31 +01:00
matrix = {
enable = true;
2021-02-05 22:12:07 +01:00
registration_shared_secret = (
lib.fileContents ./secrets/matrix-registration-shared-secret
);
2021-02-02 01:20:31 +01:00
};
2021-01-30 21:14:27 +01:00
monitoring = {
2021-01-27 20:55:16 +01:00
enable = true;
useACME = true;
domain = "monitoring.${config.networking.domain}";
2021-01-27 20:55:16 +01:00
};
postgresql-backup = {
enable = true;
};
2021-01-27 20:55:16 +01:00
};
security.acme.acceptTerms = true;
security.acme.email = "antoine97.martin@gmail.com";
networking.firewall.allowedTCPPorts = [ 80 443 ];
2021-01-27 18:22:02 +01:00
# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.openssh.permitRootLogin = "no";
services.openssh.passwordAuthentication = false;
# 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. Its 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).
system.stateVersion = "20.09"; # Did you read the comment?
boot.supportedFilesystems = [ "btrfs" ];
2021-01-31 00:31:43 +01:00
2021-01-31 14:18:23 +01:00
nixpkgs.overlays = import ./overlays;
2021-02-05 23:57:00 +01:00
nix = {
2021-02-06 01:54:21 +01:00
package = pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command flakes
'';
2021-02-05 23:57:00 +01:00
binaryCaches = [
"https://alarsyo.cachix.org"
];
binaryCachePublicKeys = [
"alarsyo.cachix.org-1:A6BmcaJek5+ZDWWv3fPteHhPm6U8liS9CbDbmegPfmk="
];
};
2021-01-27 18:22:02 +01:00
}