Initial commit

This commit is contained in:
Michael Smith 2024-07-27 16:28:37 +02:00
parent 3ba0bcd440
commit e2d99b628d
7 changed files with 251 additions and 1 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
result-*
result
.direnv
*.qcow2
*.img

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2024 nixup
Copyright (c) 2024 Michael Smith
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

32
README.md Normal file
View File

@ -0,0 +1,32 @@
# Desk OS - A simple, general purpose operating system for desktop computers
## Installation
1. Download the latest [Desk OS installation ISO](https://github.com/nixup-io/desk-os/releases/download/v1.0.0/desk-os-v1.0.0-installer.iso)
2. Flash it to a suitable USB drive
3. Boot it and install it
**Notes**
- The installation ISO assumes you are booting with UEFI and will partition the destination disk with GPT and enable full disk encryption (LUKS).
- After booting into the installed system for the first time and entering the chosen full disk encryption password, you'll be greeted with the login screen. You log in with the user account name you set during installation and the default password is `changeme`.
## Run a Desk OS demo in a virtual machine
This assumes you're running NixOS or another Linux distribution and have the Nix package manager installed.
```sh
nix run github:nixup-io/desk-os
```
## Contact
- E-mail: [info@nixup.io](mailto:info@nixup.io)
- X: [@michaelshmitty](https://x.com/michaelshmitty)
- Fediverse: [@neo](https://social.hacktheplanet.be/@neo)
## Acknowledgements
Desk OS is based on [Linux](https://en.wikipedia.org/wiki/Linux) and [NixOS](https://nixos.org/)

27
flake.lock generated Normal file
View File

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1720954236,
"narHash": "sha256-1mEKHp4m9brvfQ0rjCca8P1WHpymK3TOr3v34ydv9bs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "53e81e790209e41f0c1efa9ff26ff2fd7ab35e27",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

64
flake.nix Normal file
View File

@ -0,0 +1,64 @@
{
description = "Desk OS - A simple, general purpose operating system for desktop computers";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
};
outputs = {
self,
nixpkgs,
} @ inputs: let
supportedSystems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
# Function to generate a set based on supported systems:
forAllSystems = inputs.nixpkgs.lib.genAttrs supportedSystems;
# Attribute set of nixpkgs for each system:
nixpkgsFor = forAllSystems (system:
import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
});
in {
packages = forAllSystems (system: let
pkgs = nixpkgsFor.${system};
in {
default = self.packages.${system}.demo;
demo =
(inputs.nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./modules/desk-os
(import ./machines/demo {inherit pkgs;})
];
})
.config
.system
.build
.vm;
});
apps = forAllSystems (system: {
default = self.apps.${system}.demo;
demo = let
clean-state-demo = nixpkgsFor.${system}.writeShellScriptBin "run" ''
${self.packages.${system}.demo}/bin/run-desk-os-demo-vm
if [ -f ./desk-os-demo.qcow2 ]; then
rm ./desk-os-demo.qcow2
fi
'';
in {
type = "app";
program = "${clean-state-demo}/bin/run";
};
});
formatter = forAllSystems (system: nixpkgsFor.${system}.alejandra);
};
}

36
machines/demo/default.nix Normal file
View File

@ -0,0 +1,36 @@
{pkgs}: {modulesPath, ...}: {
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
(modulesPath + "/virtualisation/qemu-vm.nix")
];
config = {
virtualisation = {
memorySize = 8192;
qemu.options = [
"-enable-kvm"
"-vga virtio"
];
};
networking.hostName = "desk-os-demo";
# Localization
time.timeZone = "Europe/Brussels";
i18n.defaultLocale = "en_US.UTF-8";
services.xserver.xkb.layout = "us";
services.xserver.xkb.variant = "dvorak";
services.displayManager.autoLogin = {
enable = true;
user = "demo";
};
security.sudo.wheelNeedsPassword = false;
users.users.demo = {
createHome = true;
isNormalUser = true;
extraGroups = ["networkmanager" "wheel"];
initialPassword = "demo";
};
};
}

View File

@ -0,0 +1,86 @@
{
pkgs,
lib,
config,
...
}: {
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = ["nix-command" "flakes"];
boot = {
consoleLogLevel = 0;
kernelParams = ["quiet"];
initrd.verbose = false;
loader.systemd-boot.enable = true;
loader.systemd-boot.configurationLimit = 3;
loader.efi.canTouchEfiVariables = true;
plymouth = {
enable = true;
theme = "breeze";
};
};
system.autoUpgrade.enable = true;
services.printing.enable = true;
hardware.bluetooth.enable = true;
networking.networkmanager.enable = true;
console.useXkbConfig = true;
# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
i18n.inputMethod.enabled = "ibus";
services.xserver = {
enable = true;
displayManager.gdm.enable = true;
desktopManager.gnome = {
enable = true;
extraGSettingsOverrides = ''
[org.gnome.desktop.background]
picture-uri='file://${pkgs.nixos-artwork.wallpapers.mosaic-blue.gnomeFilePath}'
picture-options='scaled'
[org.gnome.shell]
# Favorite apps in gnome-shell
# favorite-apps=['org.gnome.Console.desktop', 'org.gnome.Nautilus.desktop']
# Enabled extensions
enabled-extensions=['${pkgs.gnomeExtensions.arcmenu.extensionUuid}','${pkgs.gnomeExtensions.dash-to-panel.extensionUuid}']
[org.gnome.mutter]
edge-tiling=true
'';
extraGSettingsOverridePackages = [
pkgs.gsettings-desktop-schemas # for org.gnome.desktop
pkgs.gnome.gnome-shell # for org.gnome.shell
pkgs.gnome.mutter # for org.gnome.mutter
];
};
};
services.udev.packages = with pkgs; [gnome.gnome-settings-daemon];
environment.systemPackages = with pkgs; [
firefox
gnomeExtensions.arcmenu
gnomeExtensions.dash-to-panel
];
environment.gnome.excludePackages = with pkgs; [
pkgs.gnome-tour
pkgs.gnome.epiphany
];
system.stateVersion = "24.05"; # Did you read the comment?
}