nixos-config/flake.nix
2024-10-08 08:34:41 +02:00

111 lines
3.8 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
description = "Nixos config flake test";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
};
outputs = { self, nixpkgs, nixos-wsl, nix, ... }@inputs:
let
system =
if builtins ? currentSystem
then builtins.currentSystem
else "x86_64-linux";
pkgs = import nixpkgs { inherit system; config.allowUnfree = true; };
installedPackages = (import ./installed-packages { inherit pkgs; });
in
{
nixosConfigurations.drivebystation-nixos-wsl = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
nixos-wsl.nixosModules.default
./systems/drivebystation-nixos-wsl/configuration.nix
{
system.stateVersion = "24.05";
wsl.enable = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
environment.systemPackages = [
]
++ installedPackages.mkPackages.packages;
programs.nix-ld = {
enable = true;
package = pkgs.nix-ld-rs;
};
}
];
specialArgs = { inherit inputs; };
};
nixosConfigurations.th0nkpad-nixos = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./systems/th0nkpad-nixos/configuration.nix
{
system.stateVersion = "24.05";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Define a user account. Don't forget to set a password with passwd.
users.users.andreas = {
isNormalUser = true;
description = "Andreas";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
flatpak
gnome-software
soundwireserver
vscode
# thunderbird
];
};
# Open ports in the firewall.
networking.firewall.allowedTCPPorts = [
59010 #SoundWireServer
3389 #RDP
];
networking.firewall.allowedUDPPorts = [
59010 #SoundWireServer
3389 #RDP
];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Install firefox.
programs.firefox.enable = true;
# Set up system Packages
environment.systemPackages = with pkgs; [
git
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
]
++ installedPackages.mkPackages.packages;
programs.nix-ld = {
enable = true;
package = pkgs.nix-ld-rs;
};
services.flatpak.enable = true;
systemd.services.flatpak-repo = {
wantedBy = [ "multi-user.target" ];
path = [ pkgs.flatpak ];
script = ''
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
'';
};
services.xrdp.enable = true;
services.xrdp.defaultWindowManager = "${pkgs.gnome-session}/bin/gnome-session";
# services.xrdp.openFirewall = true;
# Disable the GNOME3/GDM auto-suspend feature that cannot be disabled in GUI!
# If no user is logged in, the machine will power down after 20 minutes.
systemd.targets.sleep.enable = false;
systemd.targets.suspend.enable = false;
systemd.targets.hibernate.enable = false;
systemd.targets.hybrid-sleep.enable = false;
}
];
specialArgs = { inherit inputs; };
};
};
}