-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a base 23.11 nixos system with Gnome, GDM and nix-flatpak installed.
- Loading branch information
Showing
5 changed files
with
147 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Testing base | ||
|
||
A base GDM + Gnome `nixos` system to experiment with `nix-flatpak`. | ||
|
||
Build a qemu virtual machine with | ||
```bash | ||
nix build .#nixosConfigurations.test-system-module.config.system.build.vm | ||
``` | ||
|
||
start the system with | ||
```bash | ||
export QEMU_NET_OPTS="hostfwd=tcp::2221-:22" | ||
result/bin/run-nixos-vm | ||
``` | ||
|
||
and ssh into the vm with | ||
```bash | ||
ssh -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no antani@localhost -p 2221 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# configuration.nix | ||
{ config, lib, pkgs, ... }: { | ||
users.users.antani = { | ||
isNormalUser = true; | ||
home = "/home/antani"; | ||
extraGroups = [ "wheel" ]; # Enables `sudo` for the user. | ||
password = "changeme"; # The password assigned if the user does not already exist. | ||
}; | ||
|
||
virtualisation.vmVariant = { | ||
# following configuration is added only when building VM with build-vm | ||
virtualisation = { | ||
memorySize = 1024; # Use 1024MiB memory. | ||
cores = 2; | ||
graphics = true; # Boot the vm in a window. | ||
diskSize = 1000; # Virtual machine disk size in MB. | ||
}; | ||
}; | ||
|
||
services.openssh = { | ||
enable = true; | ||
settings.PasswordAuthentication = true; | ||
}; | ||
|
||
networking.firewall.allowedTCPPorts = [ 22 ]; | ||
environment.systemPackages = with pkgs; [ | ||
git | ||
vim | ||
]; | ||
services.xserver.enable = true; | ||
|
||
# Enable the GNOME Desktop Environment. | ||
services.xserver.displayManager.gdm.enable = true; | ||
services.xserver.desktopManager.gnome.enable = true; | ||
|
||
# Required to install flatpak | ||
xdg.portal = { | ||
enable = true; | ||
config = { | ||
common = { | ||
default = [ | ||
"gtk" | ||
]; | ||
}; | ||
}; | ||
extraPortals = with pkgs; [ | ||
xdg-desktop-portal-wlr | ||
# xdg-desktop-portal-kde | ||
# xdg-desktop-portal-gtk | ||
]; | ||
}; | ||
|
||
system.stateVersion = "23.11"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# configuration.nix | ||
{ config, lib, pkgs, ... }: { | ||
imports = [ | ||
./common.nix | ||
]; | ||
# nix-flatpak setup | ||
services.flatpak.enable = true; | ||
services.flatpak.update.auto.enable = false; | ||
services.flatpak.uninstallUnmanagedPackages = true; | ||
services.flatpak.packages = [ | ||
# ... | ||
]; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# flake.nix | ||
{ | ||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; | ||
flatpaks.url = "../"; | ||
}; | ||
outputs = inputs@{ self, nixpkgs, flatpaks, ... }: | ||
let | ||
system = "x86_64-linux"; | ||
in | ||
{ | ||
# hostname = test-system-module | ||
nixosConfigurations.test-system-module = nixpkgs.lib.nixosSystem { | ||
inherit system; | ||
modules = [ | ||
flatpaks.nixosModules.nix-flatpak | ||
./configuration.nix | ||
]; | ||
}; | ||
}; | ||
} |